One Paragraph of product description goes here
These instructions will get you a copy of the product up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
function pr () { | |
target_branch=$1 | |
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
local branch=`git name-rev --name-only HEAD` | |
echo "... creating pull request for branch \"$branch\" in \"$repo\"" | |
if [[ ! -z $target_branch ]]; then | |
open https://github.com/$repo/pull/new/$target_branch...$branch | |
else | |
open https://github.com/$repo/pull/new/$branch | |
fi |
# Adapted the script listed in the following link to maintain git history | |
# Original Script: http://snippets.dzone.com/posts/show/5449 | |
# Usage: | |
# 1) Copy the file to the root of your Rails app | |
# 2) Run the script (i.e., ruby to_haml.rb app/views) | |
class ToHaml | |
def initialize(path) | |
@path = path | |
end |
// backbone.js continues to impress, I needed to get data from a jsonp api | |
// I really wanted to do this the "right" backbone.js way and create a model and call fetch. | |
// But the default backbone synch is not jsonp | |
// Turns out you can override a synch on a per model basis (thanks stackoverflow) | |
// whats nice is backbone.js continue to work as expected with the override | |
// here's a snippet (some changes to protect our privacy). An improvement could be to create a jsonp model class which MyModel inherits | |
// the synch function is most important below, that's what tells backbone it's jsonp | |
MyModel = Backbone.Model.extend({ |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
from mmap import mmap | |
import struct | |
MMAP_OFFSET = 0x44c00000 # base address of registers | |
MMAP_SIZE = 0x48ffffff-MMAP_OFFSET # size of the register memory space | |
CM_PER_BASE = 0x44e00000 - MMAP_OFFSET | |
CM_PER_EPWMSS1_CLKCTRL = CM_PER_BASE + 0xcc | |
CM_PER_EPWMSS0_CLKCTRL = CM_PER_BASE + 0xd4 | |
CM_PER_EPWMSS2_CLKCTRL = CM_PER_BASE + 0xd8 |
// geo-location shim | |
// currentely only serves lat/long | |
// depends on jQuery | |
;(function(geolocation){ | |
if (geolocation) return; | |
var cache; |