Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
if (!navigator.geolocation) { | |
navigator.geolocation = (function (window, document) { | |
function getCurrentPosition(callback) { | |
var geourl = 'http://www.google.com/jsapi?' + Math.random(), | |
iframe = document.createElement('iframe'), | |
doc, win; | |
iframe.style.display = 'none'; | |
window.document.body.appendChild(iframe); |
# test | |
# A script to calculate some basic stats on Grant Hutchinson's haircuts. | |
# See http://splorp.com/about/haircut/ | |
# | |
# Sample output: | |
# Number of haircuts since December 22, 1998: 53 | |
# Average days between haircuts: 77 | |
# Shortest time between haircuts was April 10, 1999 to May 25, 1999 (45 days) | |
# Longest time between haircuts was August 11, 2007 to December 09, 2007 (120 days) | |
# You'll probably want a haircut in about 63 days (March 08, 2010) |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
#!/bin/sh | |
mkdir -p MinecraftDownload | |
cd MinecraftDownload | |
echo "Downloading content..." | |
cat << EOF | wget -U Mozilla/5.0 -c -N -i - | |
http://s3.amazonaws.com/MinecraftDownload/minecraft.jar | |
http://s3.amazonaws.com/MinecraftDownload/lwjgl.jar | |
http://s3.amazonaws.com/MinecraftDownload/jinput.jar | |
http://s3.amazonaws.com/MinecraftDownload/lwjgl_util.jar |
- Author: Alan Reiner (Armory)
- Orig Date: 04 April, 2012 First Draft: Sorting out ideas, and event sequences, handling details like who signs what when and where change outputs and fees fit into the equation.
Here's an example of Alice and Bob setting up the transaction. Bob posts an item on craigslist, knowing that unknown, untrusted Alice will try to buy it. In this case, Bob is the seller and will set the "Risk Deposit" (could also be "Escrow Deposit"). This can be negotiated by the buyer, but I expect that something like 15-25% would be standard and not a point of contention. Remember, buyer does not trust seller, and vice versa.
# | |
# Before running: | |
# $ gem install twitter | |
# | |
# Register a Twitter application to get auth credentials: | |
# https://dev.twitter.com/apps | |
# | |
# To run: | |
# $ ruby counter.rb upworthy.com 500 | |
# |
import Image | |
import sys | |
import glob | |
# Trim all png images with alpha in a folder | |
# Usage "python PNGAlphaTrim.py ../someFolder" | |
try: | |
folderName = sys.argv[1] | |
except : |