This file contains 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 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 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 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 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 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 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 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
// <script type="text/javascript"> | |
$(document).ready(function() { | |
$("a").hover(function() { | |
$(this).parents("p").addClass("highlight"); | |
},function() { | |
$(this).parents("p").removeClass("highlight"); | |
}); | |
}); | |
// </script> |
This file contains 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
def test_gist(): | |
print "Hello world from gist!" |
This file contains 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 |
OlderNewer