This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Zipper has @left and @right. | |
# When a zipper represents [1, 2, 3, <cursor>, 4, 5], | |
# @left == [3, [2, [1, []]]], @right == [4, [5, []]] | |
# Note that @left is in reverse order. | |
# | |
class Zipper | |
include Enumerable | |
def self.make(*vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Zipper has @left and @right. | |
# When a zipper represents [1, 2, 3, <cursor>, 4, 5], | |
# @left == [3, [2, [1, []]]], @right == [4, [5, []]] | |
# Note that @left is in reverse order. | |
# | |
class Zipper | |
include Enumerable | |
def self.make(*vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker: QUEUE=* bundle exec rake environment resque:work | |
scheduler: bundle exec rake environment resque:scheduler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OLD_DB=$1 | |
NEW_DB=$2 | |
TABLES=`echo "SHOW TABLES IN $1;" | mysql -NB` | |
IFS=" | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for more info: https://gist.github.com/1120938 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Backup | |
# Generated Template | |
# | |
# For more information: | |
# | |
# View the Git repository at https://github.com/meskyanichi/backup | |
# View the Wiki/Documentation at https://github.com/meskyanichi/backup/wiki | |
# View the issue log at https://github.com/meskyanichi/backup/issues | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm pkg install openssl | |
rvm remove 1.9.3 | |
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr --with-gcc=clang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function colours() { | |
for i in {0..255} ; do | |
printf "\x1b[38;5;${i}mcolour${i}\n" | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var easterEgg = 'egg'; | |
var eggLength = easterEgg.length; | |
var keyHistory = ''; | |
var match; | |
$(document).keypress(function(e) { | |
keyHistory += String.fromCharCode(e.which) | |
match = keyHistory.match(easterEgg); | |
if(match) { |
OlderNewer