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 python | |
| import sys | |
| import sqlite3 | |
| import argparse | |
| import re | |
| parser = argparse.ArgumentParser(description='deletes tables matching some regular expression') | |
| parser.add_argument('database', help='the database file') | |
| parser.add_argument('regexp', help='the regexp you are matching') |
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
| # [be careful, though, if you switch the order of introduction, then you will get this error: | |
| # <file>.rb:11:in `<main>': superclass mismatch for class Dog (TypeError) | |
| class Dog < Hash | |
| def silly(key) | |
| self[key] = 88 + key.to_i | |
| end | |
| end | |
| # This is the *key* point: we can re-open this class and it won't give us any trouble! | |
| class Dog |
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
| require "bundler/gem_tasks" | |
| @module_name = Mspire::Mass | |
| @gem_name = 'mspire-mass' | |
| @gem_path_name = @gem_name.gsub('-','/') | |
| require "#{@gem_path_name}/version" | |
| require 'rspec/core' | |
| require 'rspec/core/rake_task' |
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
| require 'Win32API' | |
| require 'fileutils' | |
| require 'tk' | |
| # supposed to hide base window... not working with cygwin ruby | |
| getConsoleWindow = Win32API.new("kernel32" , "GetConsoleWindow" , [] , 'L') | |
| ptr_to_console = getConsoleWindow.call() | |
| wndConsole = Win32API.new( "user32" , "ShowWindow" , ['p' , 'i'] , 'i' ) | |
| wndConsole.call( ptr_to_console , 1 ) |
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 'distribution' | |
| require 'gnuplot' | |
| require 'csv' | |
| params = { | |
| step: 0.01, | |
| stop: 1.0, | |
| xwiggle: 0.01, |
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 | |
| # sc - screenshot utility using imagemagick 'import' | |
| require 'optparse' | |
| require 'ostruct' | |
| require 'shellwords' | |
| require 'fileutils' | |
| viewers = { | |
| 'g' => 'geeqie', |
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 'open-uri' | |
| require 'mspire/digester' # gem install mspire | |
| require 'bio' | |
| require 'set' | |
| accessions = ARGV[0,2] | |
| missed_cleavages = ARGV[2].to_i |
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
| # http://rosettacode.org/wiki/Twelve_statements | |
| #1. This is a numbered list of twelve statements. | |
| #2. Exactly 3 of the last 6 statements are true. | |
| #3. Exactly 2 of the even-numbered statements are true. | |
| #4. If statement 5 is true, then statements 6 and 7 are both true. | |
| #5. The 3 preceding statements are all false. | |
| #6. Exactly 4 of the odd-numbered statements are true. | |
| #7. Either statement 2 or 3 is true, but not both. | |
| #8. If statement 7 is true, then 5 and 6 are both true. |
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
| # do what the heck you want to public license (see doc end) | |
| # gem install ruby-svg # provides SVDMatrix | |
| require 'ruby-svd' | |
| class SVDMatrix < Matrix | |
| def self.[](*rows) | |
| mat = self.new(rows.size,rows.first.size) | |
| rows.each_with_index {|row,i| mat.set_row(i, row) } | |
| mat |
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 | |
| # requires rb-inotify (will only work on linux) | |
| require 'rb-inotify' | |
| substitute = '{{}}' | |
| div = '--' | |
| if ARGV.size < 2 | |
| prog = File.basename(__FILE__) |