Skip to content

Instantly share code, notes, and snippets.

View tclh123's full-sized avatar
💭
Be an artist

Harry Lee tclh123

💭
Be an artist
View GitHub Profile
@tclh123
tclh123 / 12306.user.js
Created January 7, 2012 07:03 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
@tclh123
tclh123 / gist:2854092
Created June 1, 2012 18:08 — forked from zythum/gist:2848881
google收录的敏感词
@tclh123
tclh123 / bomb.php
Created August 30, 2013 11:29 — forked from ninehills/bomb.php
<?php
$tel_no = $_GET['hm'];
$c = $_GET['c']?$_GET['c']:0;
$c++;
?>
<!DOCTYPE html>
<html>
<head>
<title>迷你轰炸台 - 短信炸弹 - BETA!</title>
<?php
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
# config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
config.vm.forward_port 80, 8080
config.vm.network :hostonly, "192.168.10.10"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tclh123
tclh123 / .ackrc
Created January 13, 2014 13:19 — forked from kevinold/.ackrc
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code
#to install ack, see http://betterthangrep.com/
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>'
#ack will search all files in the current directory & sub-directories
#here's how I have my config file setup. this file is located on mac osx here
# ~/.ackrc
# Always sort the files
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 300 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru
import httplib
import ssl
import socket
import sys
import urllib2
class HTTPSConnectionV3(httplib.HTTPSConnection):
def __init__(self, *args, **kwargs):
httplib.HTTPSConnection.__init__(self, *args, **kwargs)
@tclh123
tclh123 / httpdump
Last active August 29, 2015 14:07 — forked from thomd/httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump='sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"'
# All the above tested only on OS X.
@tclh123
tclh123 / ctags
Last active August 29, 2015 14:09 — forked from trlinkin/ctags
--- In your ~/.ctags
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^import[ \t]*[\'\"]?([\.a-zA-Z0-9_\-]+)[\'\"]?[ \t]*/\1/i,import/
--regex-puppet=/^class[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/c,class/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/s,site/
--regex-puppet=/^node[ \t]*[\'\"]?([\.a-zA-Z0-9_\-]+)[\'\"]?[ \t]*/\1/n,node/
--regex-puppet=/^define[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^[ \t]*\$([\.a-zA-Z0-9_\-]+)[ \t]*=.*/\1/v,variable/