Skip to content

Instantly share code, notes, and snippets.

View delagoya's full-sized avatar

Angel Pizarro delagoya

View GitHub Profile
@delagoya
delagoya / test.avdl
Created July 30, 2014 19:50
Exmaple Avro files for discussion Markdown comments
@namespace("com.example")
/**
This is a comment for the whole protocol
*/
protocol Example {
/**
This is a paragraph with a
multi-line comment and
no spaces in between.
import sys
sys.path.insert(0, 'cherrypy.zip')
sys.path.insert(0, 'mako.zip')
import cherrypy
from cherrypy import tools
from mako.template import Template
from mako.lookup import TemplateLookup
import wsgiref.handlers
@delagoya
delagoya / hack
Created October 10, 2008 15:00 — forked from reinh/ship.sh
hack, ship and pause, play git shell helpers
#!/bin/sh -x
# git name-rev is fail
CURRENT=`git branch | grep '*' | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git merge master
@delagoya
delagoya / pause
Created October 10, 2008 17:03
git shell script to "pause" your work (saves branch to remote)
#!/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}
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"""
@delagoya
delagoya / README
Created December 8, 2008 14:27 — forked from mtodd/README
A collection of Rack middleware, found all over the internet and part of Merb's core.
@delagoya
delagoya / README
Created December 8, 2008 14:42
Setting session cookies from flash in Merb
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:
@delagoya
delagoya / gitx
Created December 8, 2008 17:04
open GitX on the current dir from cli
#!/bin/sh
/Applications/GitX.app/Contents/MacOS/GitX `pwd` >& /dev/null &
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.
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