Skip to content

Instantly share code, notes, and snippets.

View anler's full-sized avatar

Anler anler

View GitHub Profile
@joshuaclayton
joshuaclayton / gist:721214
Created November 30, 2010 05:36
Homebrew-installed Python with pyobjc-core and pyobjc
I use Homebrew and wanted to install pip for mercurial. Pip requires a homebrew-installed version of Python, which is fine and dandy; however, I noticed that webkit2png was broken after I installed Python with Homebrew (it was missing pyobjc libs, which comes with the OS X Python install by default).
This assumes that the current homebrewed version of Python is 2.7.1 and that homebrew is set up for /usr/local. If that's not the case, you may have to change the minor version of setuptools (e.g. from 2.7 to 2.8) and change the PATH accordingly.
$ brew install python
Modify your PATH to include the path to Python's bin directory:
export PATH="/usr/local/Cellar/python/2.7.1/bin:/usr/local/bin:$PATH"
Copyright (c) 2012, Miguel Araujo
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
@umbrae
umbrae / approx-queryset.py
Created July 6, 2011 20:32
Adding MySQL detection to approximate count queryset, taken from here: http://www.tablix.org/~avian/blog/archives/2011/07/django_admin_with_large_tables/
from django.db import connections
from django.db.models.query import QuerySet
class ApproxCountQuerySet(QuerySet):
"""Counting all rows is very expensive on large Innodb tables. This
is a replacement for QuerySet that returns an approximation if count()
is called with no additional constraints. In all other cases it should
behave exactly as QuerySet.
Only works with MySQL. Behaves normally for all other engines.
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mattdeboard
mattdeboard / runner.py
Created March 30, 2012 15:05
Django test runner
from django.conf import settings
from django.test import TestCase
from django.test.simple import DjangoTestSuiteRunner, reorder_suite
from django.utils.importlib import import_module
from django.utils.unittest.loader import defaultTestLoader
class DiscoveryDjangoTestSuiteRunner(DjangoTestSuiteRunner):
"""A test suite runner that uses unittest2 test discovery."""
def build_suite(self, test_labels, extra_tests=None, **kwargs):
@netaustin
netaustin / fabric.py
Created May 21, 2012 03:47
Fabric SSH Tunnel
from fabric.api import *
from fabric.contrib.console import confirm
from local_settings import remote_user
from time import time
import subprocess, shlex, atexit, time
from settings import DATABASES
from os import remove
env.use_ssh_config = True
env.context = 'local'
@theconektd
theconektd / vividchalkish.itermcolors
Created July 6, 2012 17:14
Colors for iTerm that are pretty close to vividchalk.vim
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now