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
-- table.copy( array, ... ) returns a shallow copy of array. | |
-- A variable number of additional arrays can be passed in as | |
-- optional arguments. If an array has a hole (a nil entry), | |
-- copying in a given source array stops at the last consecutive | |
-- item prior to the hole. | |
-- | |
-- Note: In Lua, the function table.concat() is equivalent | |
-- to JavaScript's array.join(). Hence, the following function | |
-- is called copy(). | |
table.copy = function( t, ... ) |
#!/bin/bash | |
# from | |
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html | |
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png | |
convert favicon-256.png -resize 16x16 favicon-16.png | |
convert favicon-256.png -resize 32x32 favicon-32.png | |
convert favicon-256.png -resize 64x64 favicon-64.png | |
convert favicon-256.png -resize 128x128 favicon-128.png |
# United States Postal Service (USPS) abbreviations. | |
abbreviations = [ | |
# https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States#States. | |
"AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "IA", | |
"ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO", | |
"MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", | |
"OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI", | |
"WV", "WY", | |
# https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States#Federal_district. | |
"DC", |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# CUI Downloader of "Command Line Tools for Xcode" | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
import sys, os | |
import urllib, urllib2, cookielib | |
from getpass import getpass | |
from HTMLParser import HTMLParser |
require 'net/http' | |
# WARNING do not use this; it works but is very limited | |
def resolve url | |
res = Net::HTTP.get_response URI(url) | |
if res.code == '301' then res['location'] | |
else url.to_s | |
end | |
end |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
// | |
// AppDelegate.m | |
// CallSuperMethod | |
// | |
#import <objc/objc-runtime.h> | |
#import "AppDelegate.h" | |
@interface Superclass : NSObject | |
- (NSString*)a; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
typedef enum _UIBackgroundStyle { | |
UIBackgroundStyleDefault, | |
UIBackgroundStyleTransparent, | |
UIBackgroundStyleLightBlur, | |
UIBackgroundStyleDarkBlur, | |
UIBackgroundStyleDarkTranslucent | |
} UIBackgroundStyle; | |
@interface UIApplication (UIBackgroundStyle) | |
-(void)_setBackgroundStyle:(UIBackgroundStyle)style; |