Skip to content

Instantly share code, notes, and snippets.

View fernandogrd's full-sized avatar

Fernando Grunevald fernandogrd

View GitHub Profile
class FooMixin(object):
def filter_users(self, qs):
return qs.filter(x=y)
class FooView(View, FooMixin):
def get_queryset(self):
qs = super(FooView, self).get_queryset()
qs = self.filter_users(qs)
return qs

Keybase proof

I hereby claim:

  • I am fernandogrd on github.
  • I am fernandogrd (https://keybase.io/fernandogrd) on keybase.
  • I have a public key whose fingerprint is 71A7 850D 30AD F88B 1DC5 EB31 CD08 8D46 C45E A20D

To claim this, I am signing this object:

@fernandogrd
fernandogrd / custom-script.sh
Created January 25, 2015 20:58
Running Django south migrations after codeship deploy to heroku
# Add this as a custom deploy script on Codeship, and make sure it is after Heroku Deployment
heroku_run './manage.py syncdb' name-of-heroku-app
heroku_run './manage.py migrate' name-of-heroku-app
@fernandogrd
fernandogrd / svg-path-to-json.py
Created August 15, 2012 14:54 — forked from robflaherty/svg-path-to-json.py
Extract SVG paths and convert to JSON for use with Raphael.js
import sys
import json
from xml.dom import minidom
config = {
'js_var' : 'map',
}
@fernandogrd
fernandogrd / example.py
Created September 30, 2011 19:27
example.py
import numpy as np
from pylab import *
x = np.arange(0,100,10)
y = 2 * x
plot(x,sin(x),x, cos(y))
show()