Skip to content

Instantly share code, notes, and snippets.

@pjkelly
pjkelly / app.js
Created October 27, 2017 00:12
Sample express app that acts as a proxy with CORS support.
const express = require('express');
const cors = require('cors');
const proxy = require('http-proxy-middleware');
const app = express();
const port = process.env.PORT || 8080;
const onProxyReq = function (proxyReq, req, res) {
proxyReq.setHeader('Authorization', 'Basic SECRET');
@pjkelly
pjkelly / installer.sh
Created August 11, 2011 18:59
Installing PHPUnit via Pear on Ubuntu Lucid
# Uninstall any pre-existing packaged
# versions of phpunit
sudo apt-get remove phpunit
# Install pear via apt-get
sudo apt-get install php-pear
# Update existing pear channels
sudo pear channel-update pear.php.net
@pjkelly
pjkelly / unicorn.rb
Last active April 19, 2017 09:27 — forked from pablitoc/unicorn.rb
require 'dotenv'
Dotenv.load
listen ENV.fetch('UNICORN_PORT', 5000), :backlog => ENV.fetch('UNICORN_BACKLOG', 200).to_i
worker_processes ENV.fetch('UNICORN_CONCURRENCY', 3).to_i
timeout ENV.fetch('UNICORN_TIMEOUT', 15).to_i
preload_app true
if ENV.include?('UNICORN_LOG')
stderr_path ENV.fetch('UNICORN_LOG')
@pjkelly
pjkelly / settings.json
Created December 18, 2013 16:37
Sublime Text 3 User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"folder_exclude_patterns":
[
"log",
"tmp",
"backups",
"dump",
@pjkelly
pjkelly / latency.md
Last active December 29, 2015 10:59
Traceroutes on Level3 and Google primary DNS servers to demonstrate horrible latency.

Level3 Primary DNS Server

9:57AM PST

[~]$ traceroute 209.244.0.3
traceroute to 209.244.0.3 (209.244.0.3), 64 hops max, 52 byte packets
 1  192.168.1.1 (192.168.1.1)  2.784 ms  9.760 ms  0.813 ms
 2  cpe-75-85-84-1.socal.res.rr.com (75.85.84.1)  44.614 ms  30.433 ms  29.802 ms
 3  tge7-1.lkercaag01h.socal.rr.com (76.166.2.81)  16.298 ms  8.776 ms  9.288 ms
@pjkelly
pjkelly / 1-terminal.log
Created October 24, 2013 23:43
Boxen/Librarian Puppet Issues
$ librarian-puppet install --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: x86_64-darwin12.4.0
[Librarian] Rubygems Version: 1.8.23
[Librarian] Librarian Version: 0.0.24
[Librarian] Librarian Adapter: puppet
[Librarian] Project: /opt/boxen/repo
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /opt/boxen/homebrew/bin/git
sta|Loading document...
msg|inf||loading HTML input: -
msg|err|-:12|Tag main invalid
msg|err|-:12|Tag header invalid
msg|err|-:15|Tag nav invalid
msg|err|-:20|Tag nav invalid
msg|err|-:35|Tag section invalid
msg|err|-:37|Tag article invalid
msg|err|-:46|Tag article invalid
msg|err|-:58|Tag section invalid
@pjkelly
pjkelly / settings.json
Last active December 20, 2015 09:18
Sublime Text User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"folder_exclude_patterns": [
"log",
"tmp",
"backups",
"dump",
".git",
@pjkelly
pjkelly / 1-ruby-2-installation-steps.sh
Last active December 19, 2015 21:08
Installing Ruby 2 and making sure it works with OpenSSL.
brew update
brew upgrade rbenv
brew upgrade ruby-build
brew install openssl
brew link openssl --force
brew install curl-ca-bundle
CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.0.0-p247
@pjkelly
pjkelly / stats.json
Created July 2, 2013 02:21
New Stats JSON
{
"id": "51b95267f44092b6a5000004",
"last_updated_at": "2013-07-01T19:01:30-07:00",
"statistics": [
{
"id": "51b9665f64eb2bd988000003",
"type": "text",
"label": "<p><strong>Original ideas we have dared to imagine for our clients</strong></p>\n",
"data": [
"<p>Gnm</p>\n",