Skip to content

Instantly share code, notes, and snippets.

View nisc's full-sized avatar
🐱

Natalia Sierra nisc

🐱
  • No nisc, no fun.
  • Maybe in Berlin, Germany
View GitHub Profile
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nisc
nisc / twitter_permissions_per_user.js
Created January 27, 2012 09:07
Twitter per-user permissions
/*
* Simple example that shows how to set the requested Twitter access
* permissions on a per-user basis.
*
* For example, this is useful if you only require Direct Message permissions
* from a few users and simple read access for the rest.
*
* 1. Set up your application to request R/W/DM by default in
* the app settings (https://dev.twitter.com/apps/)
* 2. Set the OAUTH_KEY and OAUTH_SECRET environment variables and start this server.
@nisc
nisc / resources.py
Created January 2, 2012 16:33 — forked from bohde/resources.py
Tastypie support for Geodjango distance filtering
class MyGeoResource(Resource):
def apply_sorting(self, objects, options=None):
if options and "longitude" in options and "latitude" in options:
return objects.distance(Point(options['latitude'], options['longitude'])).order_by('distance')
return super(MyGeoResource, self).apply_sorting(objects, options)
@nisc
nisc / .tmux.conf
Created December 8, 2011 16:56
tmux config
###
### Bindings
###
unbind C-b
set -g prefix C-a
bind a send-prefix
# URL viewing
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "xterm -e 'cat /tmp/tmux-buffer | urlview'"
@mhulse
mhulse / admin.py
Created September 19, 2011 19:25
Django google maps v3 snipplet [via] admin example (tested in Django 1.4.x) (second example)
from <app_name>.models import Foo
# ...
# Using the default admin interface:
admin.site.register(Foo)
@mhulse
mhulse / admin.py
Created September 6, 2011 04:33
Django google maps v3 snipplet [via] admin example (tested in Django 1.4.x)
from django.contrib import admin
from myapp.models import Foo
from myapp.forms import FooForm
class FooAdmin(admin.ModelAdmin):
form = FooForm
prepopulated_fields = { 'slug': ['title'] }