This file contains hidden or 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 Sidekiq | |
class AV_lb1 < Web; include Sidekiq; end | |
class AV_lb2 < Web; include Sidekiq; end | |
class AV_lb3 < Web; include Sidekiq; end | |
end | |
%w/lb1 lb2 lb3/.each do |node_name| | |
cls = "Sidekiq::AV_#{node_name}".constantize |
This file contains hidden or 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
now = Time.now | |
s = Schedule.new now | |
s.add_recurrence_rule Rule.weekly(4) | |
s.add_exception_rule Rule.weekly(12) | |
s.add_recurrence_rule Rule.weekly(13) |
This file contains hidden or 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
set :rails_env, ( ENV['RAILS_ENV'] = 'staging' ) | |
set :ssh_name, "stage.#{application}" | |
desc "Use with deploy to push live" | |
task :live do | |
set :rails_env, ( ENV['RAILS_ENV'] = 'production' ) | |
set :ssh_name, "live.#{application}" | |
end | |
before 'deploy:setup', :set_server |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="pouchdb.js"></script> | |
<script type="text/javascript"> | |
var db; | |
$(function() { | |
db = new PouchDB('foo'); |
This file contains hidden or 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
def fib x | |
x <= 1 ? x : fib(x-1) + fib(x-2) | |
end |
This file contains hidden or 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
--- Portfile.orig 2013-02-06 14:04:05.000000000 -0800 | |
+++ Portfile.new 2013-02-06 14:04:10.000000000 -0800 | |
@@ -89,6 +89,7 @@ | |
--with-mhash=${prefix} \ | |
--with-pcre-regex=${prefix} \ | |
--with-readline=${prefix} \ | |
+ --with-libexpat-dir=${prefix} \ | |
--with-libxml-dir=${prefix} \ | |
--with-zlib=${prefix} \ | |
--without-pear \ |
This file contains hidden or 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
[4] pry(main)> x = 'foo' | |
=> "foo" | |
[5] pry(main)> <<-'X' | |
[5] pry(main)* No interpolation of #{x} | |
[5] pry(main)* X | |
=> " No interpolation of \#{x}\n" | |
[6] pry(main)> <<-"X" | |
[6] pry(main)* Interpolates #{x} | |
[6] pry(main)* X | |
=> " Interpolates foo\n" |
This file contains hidden or 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
tags() { | |
dir=$1 | |
if [[ "$dir" == "" ]]; then | |
dir='.' | |
fi | |
if [[ ! -d $dir ]]; then | |
echo $'\e[1;31m'Error: $dir is not a directory.$'\e[0m' | |
return 1 | |
fi |
This file contains hidden or 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
#!/usr/bin/env ruby | |
File.open( 'report.txt', 'w' ) do |io| | |
io.puts <<-EOI | |
Dear Karla, | |
You're fucked, please quit. | |
Regards, | |
The Internet |
This file contains hidden or 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
13:31:08 1.0 ~/work/gems/rubysl-dl $ wc -l `find . -iname '*.rb'` | |
193 ./ext/rubysl/dl/extconf.rb | |
49 ./ext/rubysl/dl/install.rb | |
225 ./ext/rubysl/dl/lib/dl/import.rb | |
149 ./ext/rubysl/dl/lib/dl/struct.rb | |
245 ./ext/rubysl/dl/lib/dl/types.rb | |
25 ./ext/rubysl/dl/lib/dl/win32.rb | |
69 ./ext/rubysl/dl/mkcall.rb | |
63 ./ext/rubysl/dl/mkcallback.rb | |
25 ./ext/rubysl/dl/mkcbtable.rb |