Skip to content

Instantly share code, notes, and snippets.

Simon Chiang thinkerbot

  • Denver, CO
Block or report user

Report or block thinkerbot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thinkerbot
thinkerbot / signal_check.rb
Created Apr 30, 2009
Signals on different platforms.
View signal_check.rb
######################################################
# This is to check what signals are available from the
# command line on different platforms.
#
# === Results
#
# Mac:
# ctrl-T: INFO
# ctrl-\: QUIT
# ctrl-Z: TSTP
@thinkerbot
thinkerbot / env_inheritance.rb
Created May 6, 2009
a check of ENV inheritance
View env_inheritance.rb
# This script demonstrates that ENV variables are inherited
# in system calls. The printout (assuming VARIABLE is not
# set beforehand) is:
#
# % ruby env_inheritance.rb
# before:
# reset: blue
# system: blue
# popen: blue
# after: blue
View rack_utils_optimizations.rb
require 'benchmark'
require 'rack'
include Rack::Utils
# This illustrates the little optimizations to Rack::Utils that you might
# consider. The parse_query optimization prevents the regeneration of the
# default separator regexp:
#
# /[#{d}] */n
@thinkerbot
thinkerbot / README
Created May 16, 2009
a jquery issue in firefox extensions
View README
== JQuery Extension
Illustrates that something in jquery > 1.2.6 causes toolbars in other
extensions to disappear. To see the issue, first install an extension that
will disappear like Web Developer (link below). Web Developer adds a toolbar
all across the top of the browser.
Then enable this extension by moving the 'jquery_ext@tap.rubyforge.org' file
into your Firefox profile directory (be sure to add the full path to this
directory into the file first). For example:
@thinkerbot
thinkerbot / yaml_domain_type.rb
Created May 27, 2009
add a domain type to YAML
View yaml_domain_type.rb
# Demonstrates how to add a domain type to YAML. Note
# that the namespace and year have to be as written...
# "tap.rubyforge.org,2009" doesn't work, for instance.
require 'yaml'
YAML::add_domain_type( "tap.yaml.org,2002", "object" ) do |type, val|
"loaded: #{type} (#{val})"
end
puts YAML.load("!tap/object foo")
@thinkerbot
thinkerbot / sample.rb
Created Jun 18, 2009
A stand-alone Task executable
View sample.rb
#! /usr/bin/env ruby
require 'rubygems'
require 'tap/task'
# Sample::task a sample task
#
# This is a sample of a task used as an executable. This is a sample of a
# task used as an executable. This is a sample of a task used as an
# executable.
@thinkerbot
thinkerbot / .gitignore
Created Jun 19, 2009
20090619 ECM data extraction
View .gitignore
data
results
config
@thinkerbot
thinkerbot / Rapfile
Created Jun 19, 2009
20090619 Peptide Mass Calculation
View Rapfile
require 'ms/in_silico/digester'
require 'ms/fasta/archive'
require 'molecules'
require 'tap'
# PeptideMasses::task
#
# % rap peptide_masses <fasta_file>
#
class PeptideMasses < Tap::Task
@thinkerbot
thinkerbot / anonymous_class.rb
Created Aug 14, 2009
Danger of accessing constant name during inheritance
View anonymous_class.rb
# This illustrates the danger of accessing the constant name
# of a child class during inheritance (ex by to_s). The
# constant name will not be set at the time of inheritance
# if the class was is using Class.new.
class A
class << self
attr_accessor :const_name
def inherited(child)
You can’t perform that action at this time.