Discover gists
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 'open-uri' | |
require 'rubygems' | |
require 'hpricot' | |
ARGV.each do |gi| | |
# Fetch the URL and pass the contents to Hpricot | |
url = "http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&id=#{gi}&rettype=fasta&retmode=xml" | |
doc = Hpricot.XML(open(url).read) | |
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
use Cache::Memcached; | |
use IO::Socket::INET; | |
my $testaddr = "127.0.0.1:22122"; | |
my $msock = IO::Socket::INET->new(PeerAddr => $testaddr, | |
Timeout => 3); | |
my $memd = Cache::Memcached->new({ | |
servers => [ $testaddr ] | |
}); |
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
GiftMessage = $.klass({ | |
initialize: function(options) { | |
this.hoverClass = 'HoverItem'; | |
}, | |
onmouseover: function() { | |
this.element.addClass(this.hoverClass); | |
}, | |
onmouseout: function() { |
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
def helloworld(self): | |
print "Hello World" | |
helloworld() |
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
/* add shadow to page */ | |
$("#body").wrap("<div id=\"body-shadow\" style=\"width:800px; margin: auto; padding: 0 4px 5px 0;\"></div>"); | |
var border = RUZEE.ShadedBorder.create( | |
{ | |
corner: 1, | |
shadow: 8, | |
border: 0, | |
borderOpacity: 0.8 | |
} | |
); |
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
#!/bin/sh | |
export COLUMNS=$COLUMNS # term width isn't exported properly :( | |
export PS1='`ps1`' | |
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
include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper | |
module ActiveRecord | |
class Base | |
def self.sanitize(attr_name, options = {}) | |
define_method "#{attr_name}=" do |val| | |
write_attribute attr_name, val | |
html = '' |
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
####<Jul 25, 2008 5:04:19 PM EDT> <Error> <HTTP> <nclwebdevapp02> <NCLWEBDEVAPP02> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=67489679,name=myncl,context-path=/myncl)] Servlet failed with IOException | |
java.io.FileNotFoundException: /home/weblogic/bea/user_projects/domains/NCLWEBDEVdom/./NCLWEBDEVAPP02/.wlnotdelete/extract/NCLWEBDEVAPP02_myncl_myncl/jsp_servlet/_common/_layout/__home_template.java (No such file or directory) | |
at java.io.FileOutputStream.open(Native Method) | |
at java.io.FileOutputStream.<init>(FileOutputStream.java:179) | |
at java.io.FileOutputStream.<init>(FileOutputStream.java:131) | |
at java.io.FileWriter.<init>(FileWriter.java:73) | |
at weblogic.servlet.jsp.Jsp2Java.makeOutputStream(Jsp2Java.java:301) | |
at weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:337) | |
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:286) | |
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:388) |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1='\[\e[31;1m\]\u@\h:\w$(parse_git_branch)$ \[\e[0m\]' | |
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
'class' branch: (refactoring to make Flac2mp3 a class, use instance behavior, &c) | |
53 bin/flac2mp3 | |
151 lib/flac2mp3.rb | |
94 spec/flac2mp3_command_spec.rb | |
746 spec/flac2mp3_spec.rb | |
Total score = 145.244414937566 | |
Flac2mp3#convert_tags: (32.3) | |
20.9: assignment |