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 | |
// composer require "larryli/ipv4=~1.0" | |
include 'vendor/autoload.php'; | |
$monipdb = new \larryli\ipv4\MonipdbQuery('17monipdb.dat'); | |
if (!$monipdb->exists()) { | |
$monipdb->init(); | |
} |
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
#!/bin/sh | |
# sudo ./install-shadowsocks-local-service.sh | |
cp shadowsocks-local.default /etc/default/shadowsocks-local | |
cp shadowsocks-local.init /etc/init.d/shadowsocks-local | |
chmod +x /etc/init.d/shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc0.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc1.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc2.d/K01shadowsocks-local | |
ln -s ../init.d/shadowsocks-local /etc/rc3.d/K01shadowsocks-local |
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
#!/bin/sh | |
# If you would like to do some extra provisioning you may | |
# add any commands you wish to this file and they will | |
# be run after the Homestead machine is provisioned. | |
# install phalcon | |
phalcon_so="`php-config --extension-dir`/phalcon.so" | |
if [ ! -f $phalcon_so ]; then | |
# apt-get install -y php5-dev php5-mysql gcc libpcre3-dev |
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
div.geolocationpicker { | |
width: 100%; | |
height: 400px; | |
border-radius: 7px; | |
box-shadow: 0pt 2px 4px rgba(0, 0, 0, 0.4); | |
margin: 0.5em 0 1em; | |
clear: both; | |
} | |
div.geolocationpicker div.geo-bar { |
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
;(function($) { | |
var settings = { | |
options: { | |
timeout: 5000, | |
maximumAge: 100 | |
} | |
}; | |
var busy = false; | |
var lat, lng, doneFunc; |
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
;(function($) { | |
function outOfChina(lat, lng) { | |
if ((lng < 72.004) || (lng > 137.8347)) { | |
return true; | |
} | |
if ((lat < 0.8293) || (lat > 55.8271)) { | |
return true; | |
} | |
return false; | |
} |
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
package main | |
import ( | |
"fmt" | |
. "gist.github.com/9521299.git" | |
"github.com/kr/beanstalk" | |
"time" | |
) | |
func main() { |
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
// Package offers a function that die err message if err not nil. | |
// | |
// import . "gist.github.com/9521299.git" | |
// Die(err, something...) | |
// | |
package gist9521299 | |
import ( | |
"fmt" | |
"os" |
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
package main | |
import ( | |
"fmt" | |
. "gist.github.com/9521299.git" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
) | |
func main() { |
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
// echo {"a":"b"} | go run json-fmt.go [-prefix ""] [-indent " "] | |
// go run json-fmt.go [-prefix ""] [-indent " "] {\"a\":\"b\"} | |
// go run json-fmt.go [-prefix ""] [-indent " "] -file data.json | |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
. "gist.github.com/9521299.git" |