Skip to content

Instantly share code, notes, and snippets.

View davedash's full-sized avatar
🏠
Working from home

Dave Dash davedash

🏠
Working from home
View GitHub Profile
@davedash
davedash / gist:170586
Created August 19, 2009 19:03
Cheat Sheet
To clone an svn repo:
git svn clone http://host/ -T projects/mozilla.com/trunk
To branch from master:
git checkout -b 497185-mobile-home master
you can do aliases
javascript:navigator.geolocation.getCurrentPosition(function(p) {window.location='http://maps.google.com/maps?q=http://blockchalk.com/api/v0.6/chalks/'+p.coords.latitude+','+p.coords.longitude; });
javascript:c=gApplication.getMap().getCenter();window.location="http://maps.google.com/maps?q=http://blockchalk.com/api/v0.6/chalks/"+c.lat()+","+c.lng()

Middleware:

  • In review:
    • parsing out /en-US/ and /firefox/ from urls
  • Parse out the Cake cookie from AMO so that logins from Remora can work in Zamboni

If there's time...

Search:

@davedash
davedash / Serialize Django things
Created January 20, 2010 00:01
Great for fixtures
from django.core.serializers import serialize
serialize('json', [list, of, objects], indent=4)
ids = [a_list, of, ordered, ids]
addons = Addon.objects.filter(id__in=ids).extra(
select={'manual': 'FIELD(id,%s)' % ','.join(map(str,ids))},
order_by=['manual'])
runtime plugin/pythonhelper.vim
if !exists("*TagInStatusLine")
function TagInStatusLine()
return ''
endfunction
endif
if !exists("*haslocaldir")
function! HasLocalDir()
return ''
endfunction
@davedash
davedash / a.diff
Created March 31, 2010 19:32
a.diff
diff --git a/apps/search/client.py b/apps/search/client.py
index 2cb0813..7f38415 100644
--- a/apps/search/client.py
+++ b/apps/search/client.py
@@ -1,4 +1,6 @@
import re
+import socket
+import logging
from django.conf import settings
git-url='echo http://github.com/jbalogh/zamboni/commits/$(git log -1 --oneline|cut -f1 -d" ") '
[core]
excludesfile = /Users/dash/.gitexcludes
[alias]
co = checkout
st = status
ci = commit
sr = svn rebase
quicklog = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
[color]
diff = auto