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
'use strict'; | |
var list = location.search.substring(1).split('&'); | |
var map = {}; | |
for (var i = 0; i < list.length; i++) { | |
var kv = list[i].split('='); | |
map[kv[0]] = decodeURIComponent(kv[1]); | |
} |
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
server { | |
server_name try.c9n.me; | |
listen 80; | |
root /Users/lynn/Desktop; | |
index index.html index.htm; | |
location ~ \.gif { | |
add_header Last-Modified ""; | |
if_modified_since off; |
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/bash | |
set -o nounset | |
set -o errexit | |
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() { | |
if (!window.console) { | |
window.console = {}; | |
} | |
var m = [ | |
"log", "info", "warn", "error", "debug", "trace", "dir", "group", | |
"groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd", | |
"dirxml", "assert", "count", "markTimeline", "timeStamp", "clear" | |
]; |
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 | |
/** | |
* An helper file for Laravel 4, to provide autocomplete information to your IDE | |
* Generated with https://github.com/barryvdh/laravel-ide-helper | |
* Updated for Laravel 4.2.1 (2014-06-01) | |
* | |
* @author Barry vd. Heuvel <[email protected]> | |
*/ | |
namespace { |
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
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ | |
sed -e s/,.*//g | \ | |
grep -v ^# | \ | |
uniq | \ | |
grep -v "\[" ; |
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 ruby | |
app = `cat app_rec.lst | awk '{ print $1 }'`.split("\n").shuffle | |
og = `cat online_game_rec.lst | awk '{ print $1 }'`.split("\n").shuffle | |
sg = `cat single_game_rec.lst | awk '{ print $1 }'`.split("\n").shuffle | |
mag = 1 | |
output = [] | |
for i in 1..60 |
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/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
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
_complete_hosts () { | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
host_list=`{ | |
for c in ~/.ssh/config | |
do [ -r $c ] && sed -n -e 's/^[[:space:]]*Host[[:space:]]//p' $c | |
done | |
} | tr ' ' '\n'|grep -v '*'` | |
COMPREPLY=( $(compgen -W "${host_list}" -- $cur)) | |
return 0 |
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 | |
Class WeixinApi { | |
private $appid; | |
private $secret; | |
function __construct ($appid, $secret) { | |
$this->appid = $appid; | |
$this->secret = $secret; |
OlderNewer