This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Chromium Updater | |
# Download and install the newest Chromium build from http://chromium.org | |
# on Mac OS X. | |
import urllib2, os.path, sys | |
BASE_URL = 'http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/' | |
UPDATE_URL = 'http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST' | |
DOWNLOAD_PATH = os.path.expanduser('~/Downloads/Chromium Updater') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File permissions | |
run "chmod 755 ." | |
%w(public log tmp).each do |dir| | |
run "chmod -R 755 #{dir}" | |
end | |
# Remove unnecessary files | |
%w(README public/index.html public/favicon.ico public/robots.txt).each do |file| | |
run "rm #{file}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ tweet Hi mom! | |
# | |
# Put this in ~/.bashrc or wherever. | |
# If it doesn't work, make sure your ~/.netrc is right | |
# | |
# (Thanks to @anildigital for curl-fu) | |
function tweet { | |
curl -n -d status="$*" http://twitter.com/statuses/update.xml &> /dev/null | |
echo "tweet'd" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: time benchbulk.sh dbname | |
# it takes about 30 seconds to run on my old MacBook | |
BULKSIZE=1000 | |
DOCSIZE=100 | |
INSERTS=10 | |
ROUNDS=10 | |
DBURL="http://localhost:5984/$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(when (load "flymake" t) | |
(load "flymake-cursor" 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 "/PATH/TO/YOUR/pyflakes" (list local-file)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
# /api/v1/:format/new | |
# /api/v1/:format/gists/:user | |
# /api/v1/:format/:gist_id | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), | |
{ 'files[file1.ab]' => 'CONTNETS', | |
'files[file2.ab]' => 'contents' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $ tweet Hi mom! | |
# | |
# Put this in ~/.bashrc or wherever. | |
# If it doesn't work, make sure your ~/.netrc is right | |
# | |
# (Thanks to @anildigital and @grundprinzip for curl-fu) | |
# See: http://curl.netmirror.org/docs/caextract.html | |
CERTS_URI=http://curl.haxx.se/ca/cacert.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is MIT licensed: http://creativecommons.org/licenses/MIT/ | |
// Zenbe Inc (2009). | |
// Ensure our Zenbe namespaces exist. | |
window.zen = window.zen || {}; | |
window.zen.util = window.zen.util || {}; | |
/** | |
* The DropManager class provides a pleasant API for observing HTML5 drag-n-drop | |
* events, cleaning up the data that they return, and triggering the appropriate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================== | |
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
====================================================== | |
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
8.10. The article is targeted at a production environment, but keep in mind | |
this is a more generalized environment. You may have different requirements, | |
but this article should at least provide the stepping stones. | |
The article will use distribution packages where nesscary. As of 8.10 the |
OlderNewer