Skip to content

Instantly share code, notes, and snippets.

@simonw
simonw / install-lxml-osx-static-deps
Created August 14, 2009 11:43
A working recipe for installing lxml on OS X with static dependencies and no need for MacPorts or Fink
cd /tmp
wget http://codespeak.net/lxml/lxml-2.2.2.tgz
tar -xzvf lxml-2.2.2.tgz
cd lxml-2.2.2
cd libs/
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz
cd ..
python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24
sudo python setup.py install
@cstrap
cstrap / json_field.py
Created November 8, 2010 16:51 — forked from paltman/json_field.py
Serialize JSON object into a model object and retrieve a python dictionary on load
from django.db import models
from django.utils import simplejson as json
from django.conf import settings
from datetime import datetime
import time
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.strftime('%Y-%m-%d %H:%M:%S')
@carlkibler
carlkibler / oracle11xe_deploy.sh
Created July 20, 2011 20:17
Oracle 11 XE Installer for Ubuntu
#!/bin/bash
# Oracle 11 Express (XE) Installer for Ubuntu
# by Carl Scharenberg, July 18, 2011, carl.scharenberg@gmail.com
# Original blog post: http://blog.uncommonguy.com/?p=1234
#
# Use as you like, but please leave original credits in place.
# Disclaimer: Use at your own risk. Don't ever blindly run scripts without
# knowing what they do, including this one.
# Assumption: you have downloaded the Oracle 11 Express debian package from
@pithyless
pithyless / gist:1547905
Created January 1, 2012 17:52
Git track upstream repo
One time:
git remote add upstream git@github.com:foo/bar.git
git fetch upstream
git checkout -b upstream upstream/master
Each time you want to update:
git checkout upstream
git pull
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 13, 2024 02:39
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@cornchz
cornchz / sy.md
Created August 10, 2012 10:05
Notes from the Mystery Machine Bus - Steve Yegge

Notes from the Mystery Machine Bus

I've spent the past eight years (starting back in June 2004) writing elaborate rants about a bunch of vaguely related software engineering issues.

I was doing all that ranting because I've been genuinely perplexed by a set of "bizarre" world-views held dear by -- as far as I can tell -- about half of all programmers I encounter, whether online or in person.

Last week, after nearly a decade of hurling myself against this problem, I've finally figured it out. I know exactly what's been bothering me.

In today's essay I'm going to present you with a new conceptual framework for thinking about software engineering. This set of ideas I present will be completely obvious to you. You will probably slap yourself for not having thought of it yourself. Or you might slap the person next to you. In fact you probably have thought of it yourself, because it is so blindingly obvious.

@sent-hil
sent-hil / pictures.markdown
Created August 24, 2012 02:18
River (getriver.com): Keep a programming journal.

One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.

At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:

  • Todo
  • Question
  • Thought
  • Bug
  • Feature
@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@garrypolley
garrypolley / pythonfixes.sh
Created December 30, 2013 17:24
Fix python install after osx upgrade
# ASSUMES you want Python 2.7.5 as your system default
cd /usr/bin
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python python2.7
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python-config python2.7-config
sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/pythonw pythonw2.7
sudo ln -sf python2.7 python
sudo ln -sf pythonw2.7 pythonw
sudo ln -sf python2.7-config python-config
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end