Skip to content

Instantly share code, notes, and snippets.

@jesseditson
jesseditson / couchdb-ec2-install.sh
Created April 12, 2012 04:42 — forked from msmith/couchdb-ec2-install.sh
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
sudo mkdir -p /usr/local/var/run/couchdb
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@jesseditson
jesseditson / pal.js
Created February 28, 2013 22:07
A small node script for detecting if a word is a palindrome
#!/usr/bin/env node
var word = process.argv.slice(2)[0]
if(!word) return console.error("Please call this script with a word, e.g.: \n node pal.js someword")
// split the word into letters
var letters = word.split('')
var i=0
var len = letters.length
@jesseditson
jesseditson / jetstreams.py
Last active December 14, 2015 17:59
A python exercise to find the best route in a field of jetstreams: First line contains only 1 integer, which is the constant energy it takes to fly 1 mile WITHOUT jet streams. Every subsequent line contains 3 space-separated integers: the start mile marker of the jet stream, the end mile marker of the jet stream, and lastly an integer denoting t…
import sys
import os
# make sure we were called with the proper args
if len(sys.argv) < 2 :
print "Error: please call this script with a filename, e.g."
print "jetstreams.py <somefilename.txt>"
exit(1)
# make sure the file name called with exists
@jesseditson
jesseditson / .gitignore
Last active February 7, 2017 03:46
Jesse Ditson's Resume
.DS_Store
node_modules
@jesseditson
jesseditson / installSlow.sh
Created June 14, 2013 01:41
Installs 2 utilities - slow, and unslow. Will throttle your unix machine's connection to the internet. Good for testing what your website looks like on a shitty connection.
#!/bin/bash
BINEXISTS=`echo $PATH | grep /usr/local/bin`
if [ -z $BINEXISTS ]
then
echo "This script installs slow and unslow to /usr/local/bin, but it is not in your path."
echo "Please add /usr/local/bin to your path and run this script again."
exit 1
fi
if [[ $1 = "uninstall" ]]
#!/usr/bin/env node
// Copyright 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
// Dual licensed under the MIT and GPL licenses.
// Script to detect cursewords in commit messages and provide the
// offending commit sha's.
// vim: ft=javascript
var git = require('nodegit');
var curses = [ 'fuck', 'shit', 'piss', 'cunt', 'cocksucker', 'motherfucker', 'tits', 'bastard' ],
Pod::Spec.new do |s|
s.name = "UIImage+animatedGif"
s.version = "0.1.0"
s.summary = "Adds animatedGifWithAnimatedGifData methods to UIImage."
s.description = <<-DESC
This project defines a category `animatedGIF` on `UIImage`. The category defines two methods. This method creates an animated `UIImage` using the frames of the GIF in `data`:
+[UIImage animatedImageWithAnimatedGIFData:(NSData *)data]
This method creates an animated `UIImage` using the frames of the GIF loaded from `url`:
@jesseditson
jesseditson / node-debug
Last active August 29, 2015 13:56
node-debug
#!/bin/bash
node-inspector --web-port 8080 &
sleep 1
URL="http://127.0.0.1:8080/debug?port=5858"
echo "
tell application \"Google Chrome\"
@jesseditson
jesseditson / gist:9773690
Created March 25, 2014 23:26
Tunnel script
#!/bin/bash
function stopTunnels {
echo "stopping db tunnnels:"
if [ -n "$PID" ]; then
echo "stopping $PID..."
kill $PID
sleep 1
fi