Skip to content

Instantly share code, notes, and snippets.

View hardiksondagar's full-sized avatar

Hardik Sondagar hardiksondagar

View GitHub Profile
@hjr3
hjr3 / nginx.conf
Created September 23, 2012 17:58
nginx phpfpm + CORS configuration
upstream phpfpm {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name _;
root /var/www/html;
index index.php;
@mgerring
mgerring / actions.py
Created September 5, 2012 22:04
"Export to CSV" action for django admin
import unicodecsv
from django.http import HttpResponse
def export_as_csv_action(description="Export selected objects as CSV file",
fields=None, exclude=None, header=True):
"""
This function returns an export csv action
'fields' and 'exclude' work like in django ModelForm
'header' is whether or not to output the column names as the first row
"""
@corbanbrook
corbanbrook / jquery.inlineStyleFilter.js
Created July 24, 2012 16:06
jQuery :inlineStyle selector filter extention
/**
:inlineStyle filter
An inline style selector filter.
Usage: $("div:inlineStyle(display:none)"); // returns any divs with display style set to none
$("div:inlineStyle(width)"); // returns any divs with a width style set
$("div:inlineStyle"); // returns any divs with an inline style set
Written by Corban Brook @corban