Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
if Rails.env.production?
Braintree::Configuration.environment = Rails.env.staging? ? :sandbox : :production
Braintree::Configuration.merchant_id = ENV["braintree_merchant_id"]
Braintree::Configuration.public_key = ENV["braintree_public_key"]
Braintree::Configuration.private_key = ENV["braintree_private_key"]
else
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.merchant_id = "<super secret>"
Braintree::Configuration.public_key = "<super secret>"
Braintree::Configuration.private_key = "<super secret>"
@ikennaokpala
ikennaokpala / _stylist_heroku_replay.sh
Last active September 28, 2018 09:31 — forked from stefansundin/heroku-replay.sh
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
app=stylist
dev=http://stylist.mslabs.io
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
do
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")
/* A Spreadsheet-powered Twitterbot Engine, version 0.4, May 2015
by Zach Whalen (@zachwhalen, zachwhalen.net, etc.)
This code powers the backend for a front-end in a google spreadsheet. If somehow you've arrived at this code without the spreadsheet, start by making a copy of that sheet by visiting this link:
bit.ly/botsheet
All of the setup instructions are available in the sheet or (with pictures!) in this blog post:
@ikennaokpala
ikennaokpala / bootstrapping.md
Created October 29, 2016 11:56 — forked from dideler/bootstrapping.md
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

@ikennaokpala
ikennaokpala / frontendDevlopmentBookmarks.md
Created October 29, 2016 11:51 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@ikennaokpala
ikennaokpala / install.sh
Created July 28, 2016 10:40
install nginx with ngx_lua automatically under debian/ubuntu like system
#!/bin/bash
set -e
NGX_VER="1.8.0"
NDK_VER="0.2.19"
NGX_LUA_VER="0.9.16"
LUAJIT_VER="2.0.4"
LUAROCKS_VER="2.2.1"
WORKDIR=$(pwd)
NGX_INSTALL_DIR="/usr/local/nginx"
if ! [ -e "nginx-${NGX_VER}.tar.gz" ]; then
@ikennaokpala
ikennaokpala / letsencrypt.md
Created July 25, 2016 08:44 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
@ikennaokpala
ikennaokpala / README.md
Last active March 4, 2024 05:46 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).

The related Nginx options are: