Skip to content

Instantly share code, notes, and snippets.

View 8bitDesigner's full-sized avatar

Paul Sweeney 8bitDesigner

  • Cisco Meraki
  • Los Angeles
View GitHub Profile
@robrighter
robrighter / gist:897565
Created April 1, 2011 00:59
Walk a JSON/Javascript tree to grab all values for a given key
function traverse(obj,func, parent) {
for (i in obj){
func.apply(this,[i,obj[i],parent]);
if (obj[i] instanceof Object && !(obj[i] instanceof Array)) {
traverse(obj[i],func, i);
}
}
}
function getPropertyRecursive(obj, property){
@BPScott
BPScott / readme.md
Last active February 7, 2024 16:16
Github suggestion: Per-organization email overrides

This totally happened, y'all can stop +1ing this now. GitHub Blog post. Direct link to settings where you can set this.


#Per-organization / per-repo email overrides - A feature suggestion

Here the concepts "organization" and "user" are interchangeable, I'm talking about an entity that owns a repo, whether it is jQuery or John Resig. I'll stick to using organization as it best represents my original use-case.

##TL;DR

@turtlesoupy
turtlesoupy / minimal.coffee
Created September 21, 2012 06:41
Minimal example of a gracefully restarting node.js process
express = require 'express'
gracefullyExiting = false
app = express.createServer()
app.use (req, res, next) ->
return next() unless gracefullyExiting
res.setHeader "Connection", "close"
res.send 502, "Server is in the process of restarting."
@nbibler
nbibler / gist:5307941
Last active October 7, 2021 09:38
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@8bitDesigner
8bitDesigner / 1.md
Last active February 1, 2024 06:42
Git post-merge hook which, when you run `git merge` or `git pull` will then `bundle` if the project's Gemfile changed, or `npm install` if the project's package.json changed.Inspired and based off of https://gist.github.com/bumi/5706550

Make bundleing and npm installing easy

This repo has some handy handy hooks to run bundle or npm install whenever you:

  • git checkout a new branch with a different Gemfile or package.json
  • git pull a change to Gemfile or package.json

How can I has this!!?

  1. git clone https://gist.github.com/5869846.git hooks && cd hooks && chmod +x install
@8bitDesigner
8bitDesigner / _usage.js
Last active December 21, 2015 05:08
Properly inheriting objects in Javasacript
function Child() {
Parent.call(this);
}
extends(Child, Parent);
@8bitDesigner
8bitDesigner / .powrc
Last active December 28, 2015 22:09 — forked from nbibler/gist:5307941
Everything you need to use RVM _sanely_.
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
* {
box-shadow: inset 0 0 0 10px #FF009A;
width: auto;
color: #FFF;
background: rgba(0, 0, 0, 0) url(http://herogamesworld.com/images/my%20little%20pony%20games.jpg) repeat;
}
#!/bin/sh
set -e
apt-get update -q
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
apt-get install -qy openvpn curl iptables-persistent
cd /etc/openvpn
[ -f dh.pem ] || openssl dhparam -out dh.pem 2048
@8bitDesigner
8bitDesigner / ruby_engineer_task.md
Created January 26, 2016 02:41 — forked from jaredtibs/ruby_engineer_task.md
Youtube Data Checker

Data integrity is so important. We need your help to make sure we've got it.

You've received two different sets of data, each claiming to be the reliable source of truth. Write a ruby command line tool that can parse the two sets of data and output any discrepancies.

The data sits in two CSV files, each with three columns:

Account Email, YouTube Channel, Subscriber Count

You can assume the account emails are the same between files and reliable.