This is the sequence of steps to follow to create a root gh-pages
branch. It is based on a question at [SO]
cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
colors = ['Red', 'Blue', 'Green', 'Yellow', 'Black'] | |
states = ['Andhra', 'Karnataka', 'TamilNadu', 'Kerala'] | |
neighbors = {} | |
neighbors['Andhra'] = ['Karnataka', 'TamilNadu'] | |
neighbors['Karnataka'] = ['Andhra', 'TamilNadu', 'Kerala'] | |
neighbors['TamilNadu'] = ['Andhra', 'Karnataka', 'Kerala'] | |
neighbors['Kerala'] = ['Karnataka', 'TamilNadu'] |
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
# This is a reasonably well-behaved helper for command-line scripts needing to ask a simple yes/no question. | |
# It optionally accepts a prompt and a default answer that will be returned on enter keypress. | |
# It keeps asking and echoes the answer on the same line until it gets y/n/Y/N or enter. | |
# I tried to get Highline to behave like this directly, but even though it's sophisticated, I didn't like the result. | |
# This isn't especially elegant, but it is straightforward and gets the job done. | |
require 'highline/import' | |
def yesno(prompt = 'Continue?', default = true) | |
a = '' | |
s = default ? '[Y/n]' : '[y/N]' |
#! /usr/bin/env python | |
""" | |
Pounce on an open OpenTable reservation. | |
""" | |
import sys, os, time, re, mechanize, gtk, webkit, threading, random | |
rid = 1180 # OpenTable restaurant ID; 1180 = French Laundry | |
people_choices = [3, 3, 3, 4] # number of people to request for; cycles through choices |
/* | |
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
* | |
* Usage: | |
* $ casperjs screenshots.js http://example.com | |
*/ | |
var casper = require("casper").create(); |
Simple Dashing widget (and associated job) to display a Twitter search. Uses Twitter API v1.1.
##Dependencies
Add it to dashing's gemfile:
#install esseintal packages for opencv | |
apt-get -y install build-essential | |
apt-get -y install cmake | |
apt-get -y install pkg-config | |
apt-get -y install libgtk2.0-dev libgtk2.0 | |
apt-get -y install zlib1g-dev | |
apt-get -y install libpng-dev | |
apt-get -y install libjpeg-dev | |
apt-get -y install libtiff-dev | |
apt-get -y install libjasper-dev |
twd = (time) -> | |
date = new Date(time * 1e3) | |
diff = ((+new Date - date.getTime()) / 1e3) | |
ddiff = Math.floor(diff / 86400) | |
d = date.getDate() | |
m = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")[date.getMonth()] | |
y = date.getFullYear().toString().slice(2) | |
return if isNaN(ddiff) or ddiff < 0 | |
ddiff is 0 and (diff < 60 and Math.floor(diff) + "s" or diff < 3600 and Math.floor(diff / 60) + "m" or diff < 86400 and Math.floor(diff / 3600) + "h") or ddiff < 365 and d + " " + m or ddiff >= 365 and d + " " + m + " " + y |