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
# assume you have a file with lots if dates | |
d <- read.delim('datafile.txt') | |
# plot the values on Y dates on X | |
plot(d$webhits, type='l', xaxt='n', xlab='', ylab='', xlim=c(1,length(d$date))) | |
# draw the x axis | |
date.labels <- d$date[pretty(1:length(d$date),10) + 1 ] | |
axis(1,at=pretty(1:length(d$date),10),labels=date.labels) |
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
class Blat < CloudCrowd::Action | |
# Run BLAT on the input against a database with some options. | |
def process | |
#download the query DB to local disk | |
query_db = download(options[:db],File.basename(options[:db])) | |
#run blat search | |
`blat #{query_db} #{input_path} #{file_name}.result #{option[:args]}` | |
# gzip the file | |
`gzip #{file_name}.result` | |
#save the file to S3 and return the S3 URL as the result a |
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 'open-uri' | |
require 'hpricot' | |
result = Hpricot.parse(open(ARGV[0])) | |
STDERR.puts "ERROR: #{ARGV[0]}" unless result.root.name == "html" |
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 'rubygems' | |
require 'curb' | |
url = 'http://localhost:3000/workflows/new' | |
c = Curl::Easy.new(url) | |
c.multipart_form_post = true | |
post_data = [] | |
post_data << Curl::PostField.file('FILE', 'test.txt') | |
# was this |
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 'rubygems' | |
require 'sequel' | |
require 'sequel/extensions/pagination' | |
DB.create_table :projects do | |
primary_key :id | |
String :name | |
String :description, :text => true | |
DateTime :created_at | |
DateTime :updated_at |
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 'rubygems' | |
require "bindata" | |
# A .2bit file stores multiple DNA sequences (up to 4 Gb total) in a compact | |
# randomly-accessible format. The file contains masking information as well as | |
# the DNA itself. | |
# | |
# The file begins with a 16-byte header containing the following fields: | |
# | |
# signature - the number 0x1A412743 in the architecture of the machine that |
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
Ruby 1.9.2 | |
Ruby Koans for exercises http://github.com/edgecase/ruby_koans | |
Ruby for Developers | |
Text Editors only | |
Ruby 1.9.2 only | |
h1. Basics | |
1 + 2 |
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
<html> | |
<head> | |
<script src="js/jquery.js" type="text/javascript"></script> | |
<script src="js/fabric.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<canvas id="canvas" width="300" height="300" style="border: 1px solid #222" ></canvas> | |
<script type='text/javascript'> | |
var cnv; | |
cnv = fabric.Canvas("canvas"); |
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
class MyFasta | |
include Enumerable | |
attr :fh | |
def initialize(f) | |
@fh = File.open(f) | |
end | |
def self.open(f) | |
MyFasta.new(f) |
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
$ promiseutil -C phydrv | |
=============================================================================== | |
PdId Model Type Capacity Location OpStatus ConfigStatus | |
=============================================================================== | |
1 Hitachi HDS7 SATA HDD 2TB Encl1 Slot1 OK Array0 Seq. No.0 | |
2 Hitachi HDS7 SATA HDD 2TB Encl1 Slot2 OK Array0 Seq. No.1 | |
3 Hitachi HDS7 SATA HDD 2TB Encl1 Slot3 OK Array0 Seq. No.2 | |
4 Hitachi HDS7 SATA HDD 2TB Encl1 Slot4 OK Array0 Seq. No.3 | |
5 Hitachi HDS7 SATA HDD 2TB Encl1 Slot5 OK Array0 Seq. No.4 | |
6 Hitachi HDS7 SATA HDD 2TB Encl1 Slot6 OK Array0 Seq. No.5 |