Skip to content

Instantly share code, notes, and snippets.

View deltaepsilon's full-sized avatar
🤡
Moving to private repos!!!

Chris Esplin deltaepsilon

🤡
Moving to private repos!!!
View GitHub Profile
@deltaepsilon
deltaepsilon / chat_view.coffee
Created October 14, 2011 20:21
Simple Node.js/Socket.io Chat Server
Array.prototype.getUnique = ->
u = {}
a = []
for i in [0..this.length]
if this[i] in u
continue
a.push this[i]
u[this[i]] = 1
return a
sideLoad = (socket) ->
@deltaepsilon
deltaepsilon / generic_table.vb
Created October 14, 2011 20:27
Excel Functions
Sub generic_table()
'
' generic_table Macro
'
' Keyboard Shortcut: Ctrl+m
'
ActiveCell.FormulaR1C1 = "Chart Title"
Range("A1").Select
With Selection.Font
.Name = "Garamond"
@deltaepsilon
deltaepsilon / AutoHotkey.ahk
Created October 14, 2011 20:31
AutoHotkey Master File
;------------------------------------------------ Settings ------------------------------------------------------
DetectHiddenText, On
SetTitleMatchMode, 2
SetTitleMatchMode, slow
SetKeyDelay 10
SendMode Input
#NoEnv
#Hotstring EndChars -()[]{}:;'"/\?! .`n`t
#SingleInstance force
@deltaepsilon
deltaepsilon / ogv.sh
Created December 15, 2011 20:25
Loop through .mp4 files, convert to .ogv
#!/usr/bin/env bash
cd "$( dirname "$0" )"
for f in *.mp4
do
echo "Processing $f..."
ffmpeg2theora $f
done
@deltaepsilon
deltaepsilon / wp-link-repair.sql
Created January 11, 2012 17:49
Find/replace text in Wordpress MySQL post table
@deltaepsilon
deltaepsilon / wp_dump.sh
Created January 19, 2012 04:48
Wordpress Table Dump
#Dump table
mysqldump --add-drop-table -u USERNAME -pPASSWORD TABLENAME | gzip > destination_file.sql.gz
#Input table
mysql -u USERNAME -pPASSWORD TABLENAME < destination_file.sql.gz
@deltaepsilon
deltaepsilon / gist:1638037
Created January 19, 2012 04:52
Backup MySQL to s3 using Tim Kay's AWS CLI tool
#You need Tim Kay's AWS Swiss Army Knife: https://github.com/timkay/aws
echo "deleting gzips"
rm *.gz
echo "archiving isly_wordpress"
mysqldump --add-drop-table -u USERNAME -pPASSWORD isly_wordpress | gzip > isly_wordpress.sql.gz
echo "archiving calligraphy_wordpress"
mysqldump --add-drop-table -u USERNAME -pPASSWORD calligraphy_wordpress | gzip > calligraphy_wordpress.sql.gz
echo "archiving fashion_wordpress"
mysqldump --add-drop-table -u USERNAME -pPASSWORD fashion_wordpress | gzip > fashion_wordpress.sql.gz
echo "exporting gzips to s3"
@deltaepsilon
deltaepsilon / proxy.js
Created January 27, 2012 19:48
Node-Http-Proxy Reverse Proxy to Apache
http = require 'http'
httpProxy = require 'http-proxy'
options =
hostnameOnly: true
router:
'dev.getlimed.com': '127.0.0.1:8000'
'dev.cordellesplin.com': '127.0.0.1:8000'
'dev.wordpress.com': '127.0.0.1:8000'
'dev.modern-cupcake.com': '127.0.0.1:8000'
'dev.aws.com': '127.0.0.1:8000'
@deltaepsilon
deltaepsilon / backup.py
Created February 1, 2012 16:50
Backup MySQL schemas to a git repository
#!/usr/bin/ python
import sys, yaml, datetime, re
from subprocess import call, Popen, PIPE, STDOUT
config_path = sys.argv[1]
# Read config file
print 'Config: ' + config_path
config_file = open(config_path)
config_map = yaml.load(config_file)
config_file.close()
@deltaepsilon
deltaepsilon / mcrypt-php-output.txt
Created February 9, 2012 22:18
brew install -v mycrypt-php
==> Downloading http://us.php.net/get/php-5.3.6.tar.gz/from/fr.php.net/mirror
File already downloaded in /Users/christopheresplin/Library/Caches/Homebrew
/usr/bin/tar xf /Users/christopheresplin/Library/Caches/Homebrew/mcrypt-php-5.3.6
==> phpize
phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/mcrypt-php/5.3.6 --with-mcrypt=/usr/local/Cellar/mcrypt/2.5.8