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 sh | |
# Create a git.io short URL | |
function gitio() { | |
if [ $# -eq 2 ]; then | |
curl -i http://git.io/ -F "url=${1}" -F "code=${2}" | |
elif [ ! -z $1 ]; then | |
curl -i http://git.io/ -F "url=${1}" | |
else | |
echo 'Usage: gitio http://github.com/link [custom-name]' |
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
# Hash with getters and setters # | |
################################# | |
Hash.class_eval do | |
def method_missing(m, *a) | |
m.to_s =~ /=$/ ? self[$`] = a[0] : a == [] ? self[m.to_s] : super | |
end | |
end | |
hsh = {} | |
hsh.test1 = "one" |
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
###* | |
* PHP functions in CoffeeScript | |
* Author: Bohdan Zhuravel <bohdan@zhuravel.biz> | |
* | |
* And do not forget to include jQuery. | |
* Because everything requires jQuery. | |
### | |
url_decode = (string) -> | |
decodeURIComponent "#{string}".replace /\+/g, '%20' |
NewerOlder