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
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
.ui-autocomplete { | |
position: absolute; | |
top: 100%; | |
left: 0; | |
z-index: 1000; | |
float: left; | |
display: none; | |
min-width: 160px; | |
_width: 160px; | |
padding: 4px 0; |
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
# -*- encoding : utf-8 -*- | |
module AsyncResque | |
extend ActiveSupport::Concern | |
included do | |
include Sidekiq::Worker | |
def perform(*args) | |
self.class.find(args.first).send(args.last) | |
end | |
end |
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
module Resque | |
module AsyncJob | |
@@_queue= :default | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
# Set the default queue. chain method | |
def queue(new_queue = nil) |
OlderNewer