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
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
# 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
The warm weather has me thinking about prok ribs. Thought I would share my secret sauce, I guess now making it public sauce. | |
Per rack of baby-back rib: | |
1 tsp Diced ginger (you know from a jar) | |
2 big cloves garlic (diced) | |
1 tbsp Kosher salt | |
1 tbsp suger | |
pepper to taste |
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
package mz | |
{ | |
import flash.filesystem.File; | |
import flash.filesystem.FileMode; | |
import flash.filesystem.FileStream; | |
import flash.utils.Dictionary; | |
public class MzXml | |
{ | |
/** | |
* A random access parser for mzXML files. |
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
#!/bin/sh | |
/Applications/GitX.app/Contents/MacOS/GitX `pwd` >& /dev/null & |
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
This is Merb middleware to set a session cookie when the request comes from flash. | |
You must first require the module, then invoke it's use in the call chain in either rack.rb or config.ru. | |
Examples below. Note that SWFUPload by default adds a lot of post parameters with non-standard | |
ruby variable names, so merb-action-args will choke a bit on that unless you customize SWFupload | |
or just not use action-args. | |
Also note that the session information must be set as a GET parameters, e.g. in the URL request like so: | |
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
A collection of Rack middleware, found all over the internet and part of Merb's core. |
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
import cherrypy | |
from cherrypy._cpdispatch import PageHandler, LateParamPageHandler | |
import routes | |
import logging | |
import yaml | |
REST_METHODS = ('GET','PUT','POST','DELETE') | |
def is_form_post(environ): | |
"""Determine whether the request is a POSTed html form""" |
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
#!/bin/sh -x | |
CURRENT=`git branch | grep '*' | awk '{print $2}'` | |
MSG="hitting the pause button" | |
if [ $# -ne 0 ]; then | |
MSG="$1" | |
fi | |
git add . | |
git commit -m "${MSG}" | |
git push origin ${CURRENT} |