Skip to content

Instantly share code, notes, and snippets.

View brianloveswords's full-sized avatar
💭
computering

Brian J Brennan brianloveswords

💭
computering
View GitHub Profile
# Source: http://quickies.seriot.ch/index.php?id=411
# The lowest that the slider on the GUI goes is 15.
# I recommend 13 or 14 – it gets out of control very quickly.
defaults write NSGlobalDomain InitialKeyRepeat -int 13
# The lowest the GUI goes is 2
# 0 is fine to use here.
defaults write NSGlobalDomain KeyRepeat -int 0

The Mo-Factor App

In the spirit of Twelve-Factor Apps, this is a list of concrete things that you can do to make your software better. Some of it overlaps with Twelve-Factor Apps, but it's all good.

Comes in 3 types of flavour

  • Stable - something like popcorn.webmaker.org this is a high-end, high traffic site and is built to ensure that it can cope with both fast feature iteration and high peaks in traffic.
  • Immature - something like source.mozillaopennews.org this is a site in production but development is less regular and traffic less heavy. However if things do need to move quickly, or if we're especting a planned peak in traffic the app can still cope.
@brianloveswords
brianloveswords / replify.js
Created July 13, 2012 16:24 — forked from dshaw/replify.js
Add a repl to Node v0.6 or v0.8
var fs = require("fs")
, net = require("net")
, repl = require("repl")
module.exports = function replify (name, ctx) {
var repl_path = "/tmp/" + name + ".sock"
ctx || (ctx = {})
fs.unlink(repl_path, function () {
// intentionally not listening for the error. either way, we're good.
@brianloveswords
brianloveswords / LICENSE.txt
Created February 28, 2012 08:05 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@brianloveswords
brianloveswords / LICENSE.txt
Created February 28, 2012 08:05 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@brianloveswords
brianloveswords / gist:1163558
Created August 22, 2011 21:02 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job:
Web Tinkerer with Mozilla Foundation & P2PU
Favorite Python project:
Academic favorite: PyPy. I'm a sucker for language experimentation and meta-circular evaluators.
Practical favorite: flask. It's simple, it's clean (using decorators for routes is fantastic), it's self-contained. Great for prototyping and simple apps.
Favorite Conference:
It may sound like I'm sucking up, but honestly it was CodeConf. If only for Jeremy Ashkenas's talk on literate programming (but also for everything else).
@brianloveswords
brianloveswords / .emacs
Created June 7, 2011 21:22 — forked from paulosman/.emacs
Shell script that runs pyflakes and pep8
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "pychecker.sh" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakes-init)))
@brianloveswords
brianloveswords / bootstrap.sh
Created June 2, 2011 18:40 — forked from anonymous/bootstrap.sh
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
$ sudo su -
# mkdir /etc/resolver
# cat > /etc/resolver/test
nameserver 127.0.0.1
port 2155
^D
^D
$ brew install dnsmasq
$ dnsmasq --port=2155 --no-resolv --address=/.test/127.0.0.1
$ ping foo.test