Skip to content

Instantly share code, notes, and snippets.

View statico's full-sized avatar

Ian Langworth ☠ statico

View GitHub Profile
Assume the following history exists and the current branch is "topic":
A---B---C topic
/
D---E---F---G master
From this point, the result of either of the following commands:
{% if request.facebook.uid or user.is_authenticated %}
<div id="nav">
<ul>
(nav links go here)
{# User is logged in via Facebook (or hybrid account) #}
{% if request.facebook.uid %}
<li><a href="#" onclick="FB.Connect.logoutAndRedirect('{% url socialregistration.views.logout %}'); return false"
>Log Out</a></li>
import logging
from django.core import urlresolvers
class FacebookLogoutMiddleware(object):
LOGOUT_PATHS = (
urlresolvers.reverse('django.contrib.auth.views.logout'),
urlresolvers.reverse('django.contrib.auth.views.login'),
urlresolvers.reverse('django.contrib.auth.views.logout_then_login'),
#!/usr/bin/env python
#
# fancyoutput.py - quick functions to make script output pretty
#
# by Ian Langworth, 2010
#
# This code is in the public domain.
#
import sys
package Bot::BasicBot::Pluggable::Module::Maternity;
use base qw(Bot::BasicBot::Pluggable::Module);
use strict;
use warnings;
our @REPLIES = (
"slaps %s",
"slaps %s repeatedly",
"plays a rimshot",
"finds your comment hilarious, original.",

IMPORTANT! Wikified version of this page may be found here. Feel free to edit. :)

Note that since it's kind of PITA to merge changes from other gists it's recommended that you do your changes directly to the wiki!

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
Aves Commercial? Obsolete. Company bought by Zynga.

testing

  • one
  • two
  • three
# Guess My Number
#
# The computer picks a random number between 1 and 100
# The player tries to guess it and the computer lets
# the player know if the guess is too high, too low
# or right on the money
import random
print("\tWelcome to 'Guess My Number'!")
#
# /etc/ntp.conf - ntp configuration
#
# -----------------------------------------------------------------------------
# RESTRICTIONS
# -----------------------------------------------------------------------------
#
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
@statico
statico / gist:891368
Created March 28, 2011 21:53
Redbeacon local development tidbits
export PIP_RESPECT_VIRTUALENV=true
bm=$HOME/src/beautifulmind
function b () {
export PYTHONPATH=$bm:$bm/..
export DJANGO_SETTINGS_MODULE=beautifulmind.settings
# If on Mac OS X...
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
. $bm/../bin/activate