# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
<?php | |
// require glue lib | |
require 'glue.php'; | |
// create a glue object, and look up the neverending story in json format | |
// $glue->$method->$chain maps to api calls, like method/chain | |
// you can use any value, but glue will throw errors | |
$glue = new Glue('username', 'password'); | |
$response = $glue->object->get(array( | |
'objectId' => 'http://en.wikipedia.org/wiki/The_Neverending_Story', |
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
<?php $u=$_GET['u'];$l=$u();extract($l);include("view/{$u}.php"); |
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
#I usually drop something like this into my virtualenv's postactivate for some | |
#quick and handy shortcuts to common Django commands. | |
#This way dropping in to do some work on any arbitrary project is as easy as: | |
# 1. workon <project name> | |
# 2. djr | |
cd /path/to/site/root | |
#Django command shortcuts | |
alias dj='python manage.py' |
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 boto | |
cf = boto.connect_cloudfront('key1', 'key2') | |
cf.create_invalidation_request("distribution_id", ["/path1","/path2"]) |
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 | |
# Prints a list of all committers in a subversion repository, | |
# sorted by number of commits. | |
# Written by Torsten Becker <torsten.becker@gmail.com> in 2011 | |
if [[ ! $1 ]]; then | |
echo "Usage: $0 SVN-REPO-URL" | |
exit 1 | |
fi |
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
# coding:utf-8 | |
from sys import modules | |
import gc | |
import inspect | |
import six | |
from django.core.management.base import BaseCommand | |
from django.dispatch.dispatcher import Signal, WeakMethod |
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 requests | |
import json | |
class Diffbot(object): | |
""" | |
A simple Python interface for the Diffbot api. | |
Relies on the Requests library - python-requests.org | |
Usage: |
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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
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
~$ git clone -b release-4.12 git://github.com/echonest/echoprint-codegen.git | |
Cloning into 'echoprint-codegen'... | |
remote: Counting objects: 665, done. | |
remote: Compressing objects: 100% (280/280), done. | |
remote: Total 665 (delta 428), reused 612 (delta 376) | |
Receiving objects: 100% (665/665), 1.40 MiB | 578 KiB/s, done. | |
Resolving deltas: 100% (428/428), done. | |
~$ cd echoprint-codegen/ | |
~/echoprint-codegen$ cd src/ | |
~/echoprint-codegen/src$ vi Makefile # edit BOOST_CFLAGS and other variables as necessary |
OlderNewer