Skip to content

Instantly share code, notes, and snippets.

@satnami
satnami / index.js
Last active August 30, 2021 10:05
S3 routing with react routing
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { createBrowserHistory } from "history";
import configureStore from "./redux/configureStore";
import * as serviceWorker from "./serviceWorker";
import App from "./App";
import ErrorBoundary from "./pages/ErrorBoundary";
const store = configureStore();

AD-XX: <TOPIC - short, concise summary>

  • Date: <DATE - when the decision was made>
  • Deciders: <DECIDERS - list everyone involved in the decision>
  • Status: [PROPOSED | ACCEPTED | SUPERSEDED | DEPRECATED]
  • Category: <CATEGORY - use a simple grouping to help organize the set of decisions (e.g. backend, payment, user management, ...)>

Related

@satnami
satnami / bb2gh.sh
Created March 25, 2021 15:20 — forked from leosoto/bb2gh.sh
Moves all your organization's bitbucket repositories to GitHub. Note that when a repository is correctly uploaded to GitHub it is *removed* from BitBucket. Requires https://bitbucket.org/zhemao/bitbucket-cli/. Set the variables BB_* with your bitbucket credentials and GH_* variables with your GitHub credentials.
#!/bin/bash
set -e
repos=$(bb list -u $BB_USERNAME -p $BB_PASSWORD --private | grep $BB_ORG | cut -d' ' -f3 | cut -d'/' -f2)
for repo in $repos; do
echo
echo "* Processing $repo..."
echo
git clone --bare [email protected]:$BB_ORG/$repo.git
cd $repo.git
echo
@satnami
satnami / openssl.rb
Last active March 5, 2021 05:38
openssl 1.0.2
##################
# Usage
# brew install https://gist.githubusercontent.com/satnami/b32aaa0ac95224accb4c1ebf1d3f29f8/raw/59db14e8f317adb9159992c1192162dee2d7ac50/openssl.rb
##################
# This formula tracks 1.0.2 branch of OpenSSL, not the 1.1.0 branch. Due to
# significant breaking API changes in 1.1.0 other formulae will be migrated
# across slowly, so core will ship `openssl` & `[email protected]` for foreseeable.
class Openssl < Formula
desc "SSL/TLS cryptography library"
@satnami
satnami / docker-aliases.sh
Created February 21, 2021 04:41 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@satnami
satnami / merge_upstream_branches.yml
Created February 1, 2021 09:55
Github Actions to Merge upstream branches
# https://stackoverflow.com/a/61574295/2118504
# .github/workflows/example.yml
name: Merge upstream branches
on:
schedule:
# actually, ~5 minutes is the highest
# effective frequency you will get
- cron: '* * * * *'
jobs:
@satnami
satnami / ladder.md
Created January 4, 2021 04:44 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@satnami
satnami / bocker
Created October 25, 2020 13:00
bocker
# Prepare a hash. We need it to identify our container.
$ uuid="ps_$(shuf -i 42002-42254 -n 1)"
# Prepare a root dir for all the containers.
$ btrfs_path='/var/bocker' && cgroups='cpu,cpuacct,memory';
# Prepare root filesystem based on the given `$image`.
$ btrfs subvolume snapshot "$btrfs_path/$image" "$btrfs_path/$uuid" > /dev/null
# Create a cgroup
require 'rack/utils'
Rack::Utils.module_eval do
def self.set_cookie_header!(header, key, value)
case value
when Hash
domain = "; domain=" + value[:domain] if value[:domain]
path = "; path=" + value[:path] if value[:path]
max_age = "; max-age=" + value[:max_age] if value[:max_age]
expires = "; expires=" +
@satnami
satnami / aws_ssm_env.sh
Last active September 29, 2020 12:42
AWS SSM Parameter Store to Environment Variables
#!/bin/sh
# Usage:
# eval $(/dir/to/file/aws_ssm_env.sh PRODUCTION/POSTGRES)
# PRODUCTION/POSTGRES can be changed to the need path, and the script will truncate that path
# AWS Systems Manager -> Parameter Store will be stored like this
# /PRODUCTION/POSTGRES/POSTGRES_DATABASE_HOST = 10.10.10.10
# /PRODUCTION/POSTGRES/POSTGRES_DATABASE_PORT = 0000