Skip to content

Instantly share code, notes, and snippets.

View RafPe's full-sized avatar
🎯
Focusing

Rafal Pieniazek RafPe

🎯
Focusing
View GitHub Profile
@RafPe
RafPe / nginx.conf
Created July 30, 2022 19:34 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@RafPe
RafPe / cloudflare-purge-cache-service-worker.js
Created November 18, 2021 12:41 — forked from vdbelt/cloudflare-purge-cache-service-worker.js
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@RafPe
RafPe / MailinatorAliases
Created October 15, 2020 15:37 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
// Package lfshook is hook for sirupsen/logrus that used for writing the logs to local files.
package lfshook
import (
"fmt"
"github.com/sirupsen/logrus"
"io"
"log"
"os"
"path/filepath"
@RafPe
RafPe / ca.md
Created January 8, 2020 10:53 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@RafPe
RafPe / 1-setup.md
Created December 27, 2019 10:18 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@RafPe
RafPe / main.go
Created August 29, 2019 09:17
SQS Polling with golang channels
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
"fmt"
)
@RafPe
RafPe / android_instructions_23.md
Created November 24, 2018 21:47 — forked from agrcrobles/android_instructions_29.md
Setup Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

Enroll via Auth API

Primary Authentication

POST https://your-domain.okta.com/api/v1/authn

{
  "username": "[email protected]",
  "password": "GoAw@y123",
@RafPe
RafPe / Awesome_GO.md
Created March 14, 2018 23:17 — forked from aljiwala/Awesome_GO.md
Awesomeness of Golang by uhub

#awesome-go

A curated list of awesome Go frameworks, libraries and software.