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 'rubygems' | |
require 'bio' | |
triplets = %w( 1 2 3 1 2 2 4 2 1 3 2 4 3 1 1 3 4 4 2 4 1 1 1 4 2 3 1) | |
bases = %w(a c t g) | |
decoded = [] | |
bases.each do |i| | |
bases.each do |j| | |
bases.each do |k| |
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 'rubygems' | |
require 'bio' | |
triplets = %w( 1 2 3 1 2 2 4 2 1 3 2 4 3 1 1 3 4 4 2 4 1 1 1 4 2 3 1) | |
bases = %w(a c t g) | |
decoded = [] | |
bases.each do |i| | |
bases.each do |j| | |
bases.each do |k| |
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 | |
# originally from http://www.macosxhints.com/article.php?story=20060121171126988 | |
# note that the last four lines were modified from the original; | |
# I also updated the Current alias (since my /usr/bin/java* are symlinked through that) | |
# and I added the rm and removed the -h option from ln | |
cd /System/Library/Frameworks/JavaVM.framework/Versions |
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
Recipe: lulz | |
step 1. go to the grocery store | |
-> go to search.twitter.com | |
step 2. find your ingredients | |
-> search for twitpic [TERM] | |
http://search.twitter.com/search?q=twitpic+bear | |
step 3. gather your ingredients |
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
# generic module that holds configuration and serves as namespace | |
module Hoptoad | |
mattr_accessor :api_key | |
end | |
# framework-agnostic data structure holding Hoptoad-specific fields | |
class Hoptoad::Notice | |
class Error | |
def backtrace=(backtrace) |
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
# Implementation | |
class PostsController < ApplicationController | |
def index | |
@posts = Post.published | |
end | |
def new | |
@post = Post.new | |
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
class Calculator | |
def sum(a, b) | |
a + b | |
end | |
def product(a, b) | |
a * b | |
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
# via http://robots.thoughtbot.com/post/168368158/lets-get-ready-to-rummmmmmmble | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
def get_stock_name | |
doc = Hpricot(open('http://stocknames.info')) | |
names = doc / '.list ul li' | |
names[rand(names.size)].innerText |
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 'test/unit' | |
class InputFaker | |
def initialize(strings) | |
@strings = strings | |
end | |
def gets | |
next_string = @strings.shift | |
# Uncomment the following line if you'd like to see the faked $stdin#gets |
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
diff --git a/ruby_focused_unit_test.vim b/ruby_focused_unit_test.vim | |
index 6455c35..c3c35c0 100644 | |
--- a/ruby_focused_unit_test.vim | |
+++ b/ruby_focused_unit_test.vim | |
@@ -69,7 +69,7 @@ class RubyFocusedUnitTest | |
buffer.bdelete! | |
end | |
- buffer = VIM::Buffer.create DEFAULT_OUTPUT_BUFFER, :location => :below, :text => "--- Run Focused Unit Test ---\n\n" | |
+ buffer = VIM::Buffer.create DEFAULT_OUTPUT_BUFFER, :location => :below, :text => "--- Run Focused Unit Test ---\nCommand:\n#{test_command}\n\n" |
OlderNewer