Skip to content

Instantly share code, notes, and snippets.

// Handles JavaScript history management and callbacks. To use, register a
// regexp that matches the history hash with its corresponding callback.
window.HashHistory = {
// The interval at which the window location is polled.
URL_CHECK_INTERVAL : 500,
// We need to use an iFrame to save history if we're in an old version of IE.
USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8,
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
@mickm
mickm / s3helper
Created March 23, 2011 02:51
Duplicity wrapper to manage S3 backups for media files
#!/bin/bash
#
# Duplicity wrapper to manage S3 backups for media files.
#
# aptitude install duplicity python-boto
#
# Configure the settings below then run a test backup AND a test restore.
# Once working, schedule a regular backup with cron. Only one backup will
# run at a time so set a short cron period if you want.
#
@mickm
mickm / 0-readme.md
Created February 21, 2012 03:02 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@mickm
mickm / top_terms.rb
Created February 24, 2012 15:27
Pull top site search terms and top search engine terms from GA
#!/usr/bin/env ruby
GA_USER = 'foo@example.com'
GA_PASS = 'secrets!'
GA_PROPERTY = 'UA-8411317-51'
require 'rubygems'
require 'garb'
class SiteSearchTerms
@mickm
mickm / 0-readme.md
Created May 27, 2012 18:02 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@mickm
mickm / update-pingdom-iptables.sh
Created November 21, 2012 20:21
Whitelist Pingdom probe-servers in iptables.
#!/bin/bash
#
# Whitelist Pingdom probe-servers in iptables.
#
# Create a chain called "PINGDOM" and jump to it somewhere before
# the final REJECT/DROP, e.g.
#
# # New chain for Pingdom rules
# :PINGDOM - [0:0]
#
@mickm
mickm / nginx.rb
Last active December 12, 2015 04:38
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.6.tar.gz'
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url 'http://nginx.org/download/nginx-1.3.10.tar.gz'
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
@mickm
mickm / gist:6315020
Created August 23, 2013 02:41
ARM auto-vectorization gcc flags
# -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant
% strings /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal |grep adjustedRelative
colorForANSIColor:adjustedRelativeToColor:
colorForExtendedANSIColor:adjustedRelativeToColor:
%