Skip to content

Instantly share code, notes, and snippets.

@arnars
arnars / Gatsby v2 using Internet Explorer.md
Last active February 15, 2021 08:01
Tips for making Gatsby v2 working with IE / Internet Explorer

Making Gatsby work with Internet Explorer 10 and 11

I created this gist in order to help myself and others keep track of tips and tricks in order to make Gatsby v2 play nicely with Internet Explorer 10 and 11.

This is experience based. Please share your experiences when you have a solution to a problem.

External compilation of modules

If you suspect that an es6-based module is breaking your app, then try to add gatsby-plugin-compile-es6-packages and include the package as one of the modules.

@stefanprodan
stefanprodan / caddy-cfg.yaml
Last active February 16, 2024 19:51
Caddy K8s TLS
kind: ConfigMap
apiVersion: v1
metadata:
name: caddy-config
namespace: openfaas
labels:
app: caddy
data:
Caddyfile: |
sub.mydomain.com {
@thomasdarimont
thomasdarimont / readme.md
Last active March 15, 2024 08:56
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@eknowles
eknowles / martingale
Created September 10, 2012 11:05
martingale
import random
####################
# THE RULES
# 1. Play Roulette once a week for 3 hours for a year
# 2. Bring 500
# 3. Play Minimum bet on two tables on red
# 4a. If red continue to play minimum bet
# 4b. If black double bet (continue to double until red)
# 4c. If unable to double bet, reset bet to minimum
@Goles
Goles / CountryCodes.json
Created July 29, 2012 05:37
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","