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
| diff --git a/lib/page.rb b/lib/page.rb | |
| index 5c7071f..82e855e 100644 | |
| --- a/lib/page.rb | |
| +++ b/lib/page.rb | |
| @@ -4,8 +4,12 @@ require 'config' | |
| require 'lib' | |
| require 'related' | |
| require 'uploaded' | |
| +require 'fileutils' | |
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 | |
| require 'rubygems' | |
| require 'ffi-rzmq' | |
| REQUEST_RETRIES = 3 | |
| REQUEST_TIMEOUT = 2500 | |
| REQUEST_ENDPOINT = "tcp://127.0.0.1:5555" | |
| module ZMQ | |
| class Poller |
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 | |
| require 'rubygems' | |
| require 'eventmachine' | |
| require 'em-http' | |
| # | |
| def subscribe(opts) | |
| listener = EventMachine::HttpRequest.new('http://127.0.0.1/sub/'+ opts[:channel]).get :head => opts[:head] | |
| listener.callback { | |
| # print recieved message, re-subscribe to channel with | |
| # # the last-modified header to avoid duplicate messages |
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 macruby | |
| # | |
| # MacRubyで画面グリッチをフルスクリーン表示する | |
| # | |
| # http://twitter.com/negipo/status/67572370247913473 | |
| # | |
| # ## Usage | |
| # | |
| # ./glitch.rb | |
| # |
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
| package Bio::Tools::Protscale; | |
| use strict; | |
| use warnings; | |
| use base qw(Bio::Root::Root); | |
| use LWP 5.64; | |
| use HTML::TreeBuilder::XPath; | |
| use Data::Dumper; | |
| =head1 NAME |
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
| puts 'test' | |
| puts 'foovar' |
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
| # Gemfile | |
| gem "ffi-rzmq" | |
| # application.rb | |
| module Foo | |
| class Application | |
| ... | |
| config.zeromq_context = ZMQ::Context.new | |
| ... |
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
| class String | |
| def constantize_with_context(context=nil, args={:raise => true}) | |
| unless context.nil? | |
| begin | |
| const = context.const_get self.to_sym | |
| rescue NameError => e | |
| if args[:raise] | |
| raise e | |
| else | |
| return constantize_without_context |
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 perl | |
| use strict; | |
| use warnings; | |
| use File::MimeInfo::Magic; | |
| @File::MimeInfo::DIRS = qw(/usr/local/share/mime/); | |
| File::MimeInfo->rehash(); | |
| use URI; |
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
| # from http://devoh.com/posts/2009/03/couchdb-leopard | |
| # First, create the _couchdb user. | |
| sudo dscl . create /Users/_couchdb UniqueID 115 | |
| sudo dscl . create /Users/_couchdb PrimaryGroupID 115 | |
| sudo dscl . create /Users/_couchdb RealName "CouchDB Server" | |
| sudo dscl . create /Users/_couchdb NFSHomeDirectory /usr/local/pgsql/ | |
| sudo dscl . create /Users/_couchdb Password "*" | |
| sudo dscl . append /Users/_couchdb RecordName couchdb |