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 / frange2
Created November 22, 2012 15:50
"A faster range-like function that does accept float increments" from http://wiki.woodpecker.org.cn/moin/PyCkBk-1-16
def frange2(start, end=None, inc=1.0):
"A faster range-like function that does accept float increments..."
if end == None:
end = start + 0.0
start = 0.0
else: start += 0.0 # force it to be a float
count = int((end - start) / inc)
if start + count * inc != end:
# Need to adjust the count. AFAICT, it always comes up one short.
def distance_of_time_in_words(from_time, to_time = 0, include_seconds_or_options = {}, options = {})
if include_seconds_or_options.is_a?(Hash)
options = include_seconds_or_options
else
ActiveSupport::Deprecation.warn "distance_of_time_in_words and time_ago_in_words now accept :include_seconds " +
"as a part of options hash, not a boolean argument"
options[:include_seconds] ||= !!include_seconds_or_options
end
options = {
@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"
# coding: utf-8
# 加入上面一句才能使用中文注释
from pyglet.gl import * # OpenGL,GLU接口
from pyglet.window import key # 键盘常量,事件
from ctypes import c_float # 导入c类型的float
import math
import random
import time
SECTOR_SIZE = 16
@tclh123
tclh123 / userstyle.css
Created October 5, 2013 17:05
to enable user custom style
if (localStorage.userstyle){
var style = document.createElement('style');
style.textContent = localStorage.userstyle;
style.inject(document.body);
}
@tclh123
tclh123 / aria2-install-error
Created November 2, 2013 07:30
Installing aria2 on OS X using Homebrew fails
==> make install
Making install in po
if test "aria2" = "gettext-tools"; then \
.././install-sh -c -d /usr/local/Cellar/aria2/1.18.1/share/gettext/po; \
for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot Makevars.template; do \
/usr/bin/install -c -m 644 ./$file \
/usr/local/Cellar/aria2/1.18.1/share/gettext/po/$file; \
done; \
for file in Makevars; do \
rm -f /usr/local/Cellar/aria2/1.18.1/share/gettext/po/$file; \
@tclh123
tclh123 / Sentry-setup.py
Created November 7, 2013 02:25
Sentry's setup.py
#!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server