Skip to content

Instantly share code, notes, and snippets.

View darrylhebbes's full-sized avatar

Darryl Hebbes darrylhebbes

  • Berlin, Germany
View GitHub Profile
@kogakure
kogakure / settings.py
Created December 9, 2008 17:39
Python: Django Templates: settings.py, local_settings.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os.path
import sys
# Basic Settings
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
PROJECT_NAME = os.path.split(PROJECT_ROOT)[-1]
MEDIA_ROOT = '%s/media/' % PROJECT_ROOT
@smajda
smajda / aggregate-feed.php
Created October 7, 2009 16:41
Merge multiple RSS feeds with SimplePie
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
/**
Lazy-load Google gdata libraries and check for the user authorization
@gscope - the google service scope you want to be authorized to, e.g. "http://www.blogger.com/feeds"
@callback - a function to be called after succesfull authorization
*/
getGdataAndAuthorize = function(gscope, callback) {
var checkInterval,
time = 100,
@brianleroux
brianleroux / get.js
Created November 22, 2009 06:12
Lawnchair example usage
// Get that document
people.get(me.key, function(r){
console.log(r);
});
// Returns all documents as an array to a callback
people.all(function(r){
console.log(r);
});
@acdha
acdha / webfaction modern python app install notes.rst
Created November 23, 2009 00:24
Installation notes after installing a Django web app on WebFaction

Python 2.6 + Virtualenv + Django 1.1 + Postgres on WebFaction

  1. mkdir -p ~/bin ~/lib/python2.6/site-packages

  2. Configure the environment by putting something like this in your .bashrc and sourcing it:

    export CFLAGS=-I/usr/local/pgsql/include
    export LDFLAGS=-L/usr/local/pgsql/lib
    
@onyxfish
onyxfish / fabfile.py
Created February 9, 2010 23:05
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
/**
* `and` plugins for jQuery
* ---
* Pretty intuitive. Enables stuff like:
* $('a').andChildren();
* Quicker & easier than:
* $('a').children().andSelf()
*/
(function(){
console.log(blanky); // `object definition`
console.log(typeof blanky); // object
console.log(blanky.__proto__); // object
console.log(typeof blanky.__proto__); // object
console.log(blanky.constructor); // SafetyBlanket()
console.log(typeof blanky.constructor); // function
console.log(blanky.constructor.prototype); // object{}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh