Skip to content

Instantly share code, notes, and snippets.

View girvan's full-sized avatar
Hello World!

Hi girvan

Hello World!
View GitHub Profile
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/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
@henrik
henrik / eu_country_codes.rb
Last active December 20, 2023 12:20
EU (European Union) country codes, ISO 3166-1 alpha-2. (This Gist is from 2012. Please see comments for updates.)
# Note: VAT identification numbers for Greece use "EL", not "GR".
COUNTRY_CODES_EU = %w[
AT BE BG CY CZ DK EE FI FR DE GR HU IE IT
LV LT LU MT NL PL PT RO SK SI ES SE GB
]
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
淡定哥主要表情:ˊ_>ˋ
淡定哥第二表情:ˊ_ˋ
淡定哥第三表情:ˊ_>ˋ
路人第四號表情:ˊ_>ˋ
其它:
-_>- (-_>-)
@girvan
girvan / gist:2707228
Created May 16, 2012 03:53
detect mobile / tablet device and insert into body class
// this project is move to https://github.com/girvan/mobile-detection
(function(){
var device = '', _ipad = 'ipad', _iphone = 'iphone', ua = navigator.userAgent.toLowerCase();
if( ua.indexOf(_ipad) != -1 )
device = 'ios tablet ' + _ipad;
else if( ua.indexOf(_iphone) != -1 )
device = 'ios mobile ' + _iphone;
@girvan
girvan / gist:3366739
Created August 16, 2012 04:11
美妝邦粉絲團 2012.08.16 抽獎活動留言存檔
2012.08.16 12:00 抽獎留言存檔 如下,共72則
從 http://on.fb.me/PmAL3X
----------------------------------
Polly Yang 兩三天畫一次~
星期一 21:26 · 讚
朱珮綺 有出門才會畫~
@carsonmcdonald
carsonmcdonald / app.js
Created September 2, 2012 01:59
Use S3 CORS FileAPI uploader
function createCORSRequest(method, url)
{
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr)
{
xhr.open(method, url, true);
}
else if (typeof XDomainRequest != "undefined")
{
xhr = new XDomainRequest();
@ckimrie
ckimrie / city_code_helper.php
Created February 11, 2013 16:06
3 letter IATA City code to City name converter
<?php
/**
* 3-letter IATA City Code to CityName conversion
*
* Usage:
*
* $city_name = City::code("LON");
* // "London"
*
@l34marr
l34marr / city-town.py
Last active May 7, 2018 07:39
List Temple Data
cities = {
'KeelungCity': '基隆市',
'TaipeiCity': '臺北市',
'NewTaipeiCity': '新北市',
'TaoyuanCity': '桃園市',
'HsinchuCounty': '新竹縣',
'HsinchuCity': '新竹市',
'MiaoliCounty': '苗栗縣',
'TaichungCity': '臺中市',
'NantouCounty': '南投縣',
@lopezjurip
lopezjurip / README.md
Last active September 10, 2023 06:27
Write to NTFS on OSX Yosemite and El Capitan

OUTDATED, see comments below

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update