Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info
like this: $ brew info postgresql
$ brew install python --universal
Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info
like this: $ brew info postgresql
$ brew install python --universal
#!/usr/bin/env python | |
import os | |
import urllib | |
URL = 'https://raw.github.com/gist/1207150' | |
INSTALL_DIR = '/usr/local/bin/' | |
COMMAND_NAME = 'django_bootstrap' | |
command_path = "%s%s" % (INSTALL_DIR, COMMAND_NAME) | |
fh = urllib.urlopen(URL) |
#!/bin/bash | |
PROJ_DIR=$1 | |
PROJ_NAME=$2 | |
easy_install virtualenv pip; | |
mkdir -p $PROJ_DIR; | |
virtualenv $PROJ_DIR | |
source $PROJ_DIR/bin/activate |
#!/bin/sh | |
find . -name '*.pyc' -print0|xargs -0 rm |
# Setting up a local solr instance on a mac | |
# install solr with homebrew | |
brew install solr | |
# create the base solr index directory | |
mkdir -p /data/solr | |
# make sure you can write to the solr logs | |
sudo chown -R `whoami` /usr/local/Cellar/solr/ |
""" | |
Straight Include template tag by @HenrikJoreteg | |
Django templates don't give us any way to escape template tags. | |
So if you ever need to include client side templates for ICanHaz.js (or anything else that | |
may confuse django's templating engine) You can is this little snippet. | |
Just use it as you would a normal {% include %} tag. It just won't process the included text. |
// execute callback only after a pause in user input; the function returned | |
// can be used to handle an event type that tightly repeats (such as typing | |
// or scrolling events); it will execute the callback only if the given timout | |
// period has passed since the last time the same event fired | |
function createOnPause(callback, timeout, _this) { | |
return function(e) { | |
var _that = this; | |
if (arguments.callee.timer) | |
clearTimeout(arguments.callee.timer); | |
arguments.callee.timer = setTimeout(function() { |
$(function(){ | |
if (!Modernizr.input.placeholder) { | |
$('input[placeholder], textarea[placeholder]').each(function(index, elem) { | |
elem = $(elem); | |
placeholder = elem.attr('placeholder'); | |
elem_id = elem.attr('id'); | |
elem_name = elem.attr('name'); | |
clone = elem.clone(); | |
clone.hide(); |
IterableCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
//_.bindAll(this, ) | |
this._resetIndexes(); | |
}, | |
_resetIndexes: function() { | |
this.currentIndex = 0; | |
this.hasSelection = false; | |
}, | |
parse: function(response) { |
# -*- coding: utf-8 -*- | |
import datetime | |
from django.http import HttpResponse | |
from django.utils import simplejson | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext | |
class DateTimeJSONEncoder(simplejson.JSONEncoder): | |
""" |