Skip to content

Instantly share code, notes, and snippets.

View delagoya's full-sized avatar

Angel Pizarro delagoya

View GitHub Profile
@delagoya
delagoya / example.xml
Last active December 16, 2015 14:20 — forked from anonymous/example.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<indexedmzML xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.2_idx.xsd">
<mzML xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd" id="April_19_2013_sample002" version="1.1.0">
<cvList count="2">
<cv id="MS" fullName="Proteomics Standards Initiative Mass Spectrometry Ontology" version="3.30.0" URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"/>
<cv id="UO" fullName="Unit Ontology" version="12:10:2011" URI="http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/unit.obo"/>
</cvList>
<fileDescription>
<fileContent>
</fileContent>
@delagoya
delagoya / pidler_example.sh
Last active December 10, 2015 21:39
example pidler
# request a single barcode as JSON
curl http://pidler.org/bc
curl http://pidler.org/bc.json
# => {"barcodes":["PA6A24"]}
# request 3 barcodes as JSON
curl http://pidler.org/bc?num=3
curl http://pidler.org/bc.json?num=3
# => {"barcodes":["P5D1EE","PB80CB","PC70A2"]}
@delagoya
delagoya / createrumebs.py
Created February 23, 2012 16:26
RUM EBS volume using boto
#!/usr/bin/env python
import boto
from os import environ
conn = boto.connect_ec2(environ["AWS_ACCESS_KEY_ID"],environ["AWS_SECRET_ACCESS_KEY"])
size = 100
#adjust to the same zone as StarCluster config
zone = "us-east-1a"
# Description: RUMv1.09, BWAv0.6.1, Bowtie2b5, Bowtie0.12.7, GATK1.4, samtools0.1.18
snapshot = "snap-aec239d5"
@delagoya
delagoya / example.out.txt
Created January 18, 2012 20:29
Emailing reports about bad drive from Promise Pegasus
$ 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
@delagoya
delagoya / my_fasta.rb
Created October 14, 2011 14:09
Example for each() Enumerable
class MyFasta
include Enumerable
attr :fh
def initialize(f)
@fh = File.open(f)
end
def self.open(f)
MyFasta.new(f)
@delagoya
delagoya / example.fabric.html
Created September 23, 2011 01:52
Example of problem with fabric.js
<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");
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
@delagoya
delagoya / two_bit_format_parsing_example.rb
Created October 12, 2010 20:11
Example of parsing 2bit formatted genome files with Ruby BinData gem
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
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
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