gist.github.com/ursm/7420421
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
PREFIX mccv: <http://purl.jp/bio/01/mccv#> | |
PREFIX meo: <http://purl.jp/bio/11/meo/> | |
PREFIX mpo: <http://purl.jp/bio/01/mpo#> | |
PREFIX up: <http://purl.uniprot.org/core/> | |
PREFIX g: <http://purl.uniprot.org/go/> | |
SELECT DISTINCT ?uniprot_uri ?uniprot ?recommended_name ?taxonomy_uri ?taxonomy_name | |
WHERE { | |
# Taxonomy | |
{ |
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
require 'active_support/all' | |
require 'pp' | |
def grouping(rows, *keys) | |
normalized_keys = keys.inject([]) {|acc, key| | |
acc + (key.is_a?(Hash) ? key.to_a : [[key, key]]) | |
} | |
_grouping(rows, *normalized_keys) | |
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 ActiveModel | |
class MultiCacheSerializer < ArraySerializer | |
# XXX ArraySerializer の実装に依存しまくっている | |
def serializable_array | |
return super unless perform_caching && cache | |
entries = object.each_with_object({}) {|item, memo| | |
if options.has_key?(:each_serializer) | |
serializer = options[:each_serializer] | |
elsif item.respond_to?(:active_model_serializer) |
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
history = [] | |
puts 'Hello! May I help you?' | |
while words = gets.chomp | |
history << words | |
break if history.last(3) == %w(BYE BYE BYE) | |
case words |
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
/usr/local/ey_resin/ruby/lib/ruby/gems/1.9.1/gems/engineyard-serverside-2.1.0.rc1/lib/engineyard-serverside/servers.rb:113:in `run_on_each': The following command failed on server [localhost(app_master)] (EY::Serverside::RemoteFailure) | |
$ sh -l -c 'cd /data/some_app/releases/20130528110830 && PATH=/data/some_app/releases/20130528110830/ey_bundler_binstubs:$PATH RAILS_ENV=production RACK_ENV=production NODE_ENV=production MERB_ENV=production rake assets:precompile RAILS_GROUPS=assets' | |
[RailsAdmin] RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it. | |
No config found for ["New Relic", "license_key"]. Activate the services that provides 'New Relic' or remove the code that uses it. | |
/data/some_app/shared/bundled_gems/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/cache/file_store.rb:91: [BUG] Segmentation fault | |
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] | |
-- Control frame information ----------------------------------------------- |
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
/usr/local/ey_resin/ruby/lib/ruby/gems/1.9.1/gems/engineyard-serverside-2.1.0.rc1/lib/engineyard-serverside/servers.rb:113:in `run_on_each': The following command failed on server [localhost(solo)] (EY::Serverside::RemoteFailure) | |
$ sh -l -c 'cd /data/some_app/releases/20130528104523 && PATH=/data/some_app/releases/20130528104523/ey_bundler_binstubs:$PATH RAILS_ENV=production RACK_ENV=production NODE_ENV=production MERB_ENV=production rake assets:precompile RAILS_GROUPS=assets' | |
[RailsAdmin] RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it. | |
No config found for ["New Relic", "license_key"]. Activate the services that provides 'New Relic' or remove the code that uses it. | |
/data/some_app/shared/bundled_gems/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/json/encoding.rb:123: [BUG] Segmentation fault | |
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] | |
-- Control frame information ----------------------------------------------- |
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
ken = 'けん' | |
prefixes = %w(さん くん ちゃん) | |
while (ken + (prefix = prefixes.sample)).size < 140 | |
ken << prefix | |
end | |
puts ken + '…' |
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
gem 'foreman' | |
gem 'puma' | |
gem 'rainbows' | |
gem 'sendfile' | |
gem 'sleepy_penguin' | |
gem 'thin' | |
gem 'unicorn' |