Skip to content

Instantly share code, notes, and snippets.

@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@rca
rca / ajax_setup.js
Created January 29, 2012 00:27
Setup Django CSRF token in JQuery AJAX requests
/**
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off.
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request
*/
function getCookie(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
@jackowayed
jackowayed / bench.rb
Created April 11, 2011 05:34
Benchmarks your CS 107 assignment against the solution
#!/usr/bin/env ruby
require 'open3'
# Ruby doesn't realize how AFS works and is thus complaining about the
# executable it's running being world writable.
# It complains to stderr, so just suppress that.
$stderr.reopen('/dev/null', 'w')
def test(command)