Skip to content

Instantly share code, notes, and snippets.

View lsongdev's full-sized avatar
👨‍💻
Thinking ...

Lsong lsongdev

👨‍💻
Thinking ...
View GitHub Profile
#!/usr/bin/env bash
# put your hosts file into /etc/hosts.d/
#
# usage:
# chhost $your-host-name
# restore:
# chhost
HOSTD=/etc/hosts.d
//jweixin-1.0.0.js
! function(g, initFunc) {
'function' == typeof define && (define.amd || define.cmd) ? define(function() {
return initFunc(g)
}) : initFunc(g, true)
}(this,
function(glob, setGlobal) {
function invokeCmd(cmd, param, callbackObj) {
glob.WeixinJSBridge ? WeixinJSBridge.invoke(cmd, normParameter(param), function(res) {
completeBridgeInteraction(cmd, res, callbackObj);
URL.prototype.__defineGetter__('query', function() {
var params = {};
this.search.substr(1).split('&').map(function(param){
var pair = param.split('=');
params[ pair[0] ] = pair[1];
});
return params;
});
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
atom.workspace.observeTextEditors (editor) ->
editor.onDidSave ->
@lsongdev
lsongdev / gist:b8b739468a6937c7e8db
Last active September 29, 2015 06:05 — forked from netwjx/output
统计最近一段时间git版本库中代码提交量
git log '@{1 weeks ago}..HEAD' --shortstat --pretty=format:%an | awk '/.+/ {
if($2 != "file" && $3 != "changed,") {
curr = $1
} else {
files[curr]+=$1
inserts[curr]+=$4
deletes[curr]+=$6
}
}
END {
#!/usr/bin/env bash
#
LOG_DIR=/var/sankuai/logs/myfe-canary
#
DATE=$(date +%F)
PID="$LOG_DIR/myfe-canary-0.pid"
#
LOG_STDOUT="$LOG_DIR/stdout.log"
@lsongdev
lsongdev / mp4ba.sh
Last active October 12, 2015 09:58
#!/usr/bin/env bash
# curl -s https://gist.githubusercontent.com/song940/d61c5dec2359a9a324b9/raw/mp4ba.sh | bash
URL="http://www.mp4ba.com"
for i in `seq 71`; do
INDEX_CONTENT=$(curl -s "$URL/index.php?page=$i")
HASH=$(echo $INDEX_CONTENT | grep -o "hash=\w*")
for hash in `echo $HASH`; do
@lsongdev
lsongdev / LICENSE.txt
Created November 13, 2015 08:45 — forked from yckart/LICENSE.txt
Domster | Syntactic sugar for DOM-traversing
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 Yannick Albert <http://yckart.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Host *
ControlPersist yes
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
@lsongdev
lsongdev / sentry.sh
Last active January 7, 2016 14:12
send message to sentry by shell script .
#!/usr/bin/env bash
#
#
PROJECT_ID=1
SENTRY_VERSION=7
SENTRY_NAME="sentry-cli"
SENTRY_KEY=5660affd663b4e4e8f0ca25c96dce705
SENTRY_API="http://sentry.lsong.org/api/$PROJECT_ID"
ORIGIN="http://lsong.org"