This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = sorted(data) | |
times = {} | |
for single in data: | |
try: | |
times[single] += 1 | |
except KeyError: | |
times[single] = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ){ | |
$.fn.pCollapse = function( options ) { | |
var settings = { | |
'start': '100px', | |
}; | |
// there's no need to do $(this) because | |
// "this" is already a jquery object | |
// $(this) would be the same as $($('#element')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthenticatedTest(unittest.TestCase): | |
def setUp(self): | |
self.c = Client() | |
# create login | |
user = User(username = 'test', password = 'test123', first_name = 'Test', last_name = 'McTesterson', email = '[email protected]') | |
user.save() | |
# login | |
response = self.c.post('/accounts/login/', {'username': 'test', 'password': 'test123'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
virtualenv --no-site-packages "$1" | |
cd "$1" | |
source bin/activate | |
git clone 'git://github.com/zacharyvoase/django-zskel-project.git' "$1" | |
mkdir db | |
cd "$1" | |
find . -name '.empty' -exec rm {} \; | |
git config --unset remote.origin.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import simplejson | |
class GPlaces(object): | |
def __init__(self, key): | |
self.key = key | |
self.search_url = "https://maps.googleapis.com/maps/api/place/search/json" | |
def search(self, location, radius, sensor, **kwargs): | |
# Build the url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render_to_response as render | |
from django.template import RequestContext | |
from django.conf import settings | |
def render_to_response(*args, **kwargs): | |
kwargs['context_instance'] = RequestContext(args[1]['request']) | |
return render(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; turn on mouse wheel scrolling | |
(defun sd-mousewheel-scroll-up (event) | |
"Scroll window under mouse up by five lines." | |
(interactive "e") | |
(let ((current-window (selected-window))) | |
(unwind-protect | |
(progn | |
(select-window (posn-window (event-start event))) | |
(scroll-up 2)) | |
(select-window current-window)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day job: | |
Web Developer for the IIT Institute of Design | |
Favorite Python project: | |
Pip. I love what it and Virtualenv have done for my development in Django. | |
Favorite Conference: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python_pip "-r /home/vagrant/mayan/mayan/requirements/development.txt" do | |
virtualenv "/home/vagrant/mayan" | |
action :install | |
end |
OlderNewer