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
###################################################### | |
# 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 |
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
# 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 |
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 '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 |
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
== 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 '[email protected]' file | |
into your Firefox profile directory (be sure to add the full path to this | |
directory into the file first). For example: |
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
*.rbc |
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
# 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") |
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/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. |
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
data | |
results | |
config |
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 'ms/in_silico/digester' | |
require 'ms/fasta/archive' | |
require 'molecules' | |
require 'tap' | |
# PeptideMasses::task | |
# | |
# % rap peptide_masses <fasta_file> | |
# | |
class PeptideMasses < Tap::Task |
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
# 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) |