Skip to content

Instantly share code, notes, and snippets.

View vvtommy's full-sized avatar
🏠
Working from home

vvtommy

🏠
Working from home
View GitHub Profile
@vvtommy
vvtommy / gist:a2cd821c9e23d6d67294
Created October 7, 2014 02:59
wexin-simulator
# -*- coding: utf-8 -*-
import time
import random
import urllib2
import hashlib
import xml.etree.cElementTree as ET
import Tkinter as tk
import ScrolledText as st
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@vvtommy
vvtommy / gist:88418fe220920a8f7167
Created November 27, 2014 15:41
阿里云 trusty apt source.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
@vvtommy
vvtommy / nginxUserIdDecoder.php
Created June 30, 2015 01:34
Nginx User ID Decoder for PHP
function nginxUserIdDecoder($userIdInCookie){
return join(array_map(function($i){return strtoupper(dechex($i));},unpack("L*", base64_decode("wKjHwFWR6Ka5RHopAwMNAg=="))), "");
}
@vvtommy
vvtommy / LICENSE.txt
Created January 21, 2012 18:18 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
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
@vvtommy
vvtommy / 3-1-2012_14_39_51.log
Created March 1, 2012 07:11
evernote error log on Chrome 19.0.1055.1 dev-m (Windows)
03/01/2012 14:39:53.441 0800 [DEBUG] [ChromePopup] Initializing...
03/01/2012 14:39:53.448 0800 [DEBUG] [ChromePopup] Popup.initOptions
03/01/2012 14:39:53.456 0800 [EXCEPTION] [popupHtml]
extensions/schema_generated_bindings.js:60: Uncaught Error: Invalid value for argument 1. Expected 'string' but got 'object'.
@vvtommy
vvtommy / document_write_foo.js
Created November 30, 2012 07:35
测试IE下一个错误
document.write('foo');
@vvtommy
vvtommy / openvpn_pam_initialie_tables.sql
Created December 2, 2012 08:35
pam_mysql进行OpenVPN认证的表结构
-- 创建数据库
CREATE DATABASE openvpn;
-- 切换数据库
USE openvpn;
-- 创建用户,用户名openvpn,密码openvpn(可自行设定)
GRANT ALL ON openvpn.* TO 'openvpn'@'localhost' IDENTIFIED BY 'openvpn';
-- 创建用户数据表
@vvtommy
vvtommy / gist_usage_example.js
Created December 3, 2012 09:37
介绍Wordpress Gist插件所做的实例
/**
* debug function
* dumps out objects
* @param {object} obj object that needs to bee printed to the log
* @return {string}
*/function dump(obj) {
var out = '';
for (var i in obj) {
out += i + ": " + obj[i] + "\n";
}
@vvtommy
vvtommy / CoffeeScript_Sublime_Plugin.0.5.3.patch
Created December 5, 2012 04:21
CoffeeScript-Sublime-Plugin 0.5.3 syntax highlighting patch
--- ./CoffeeScript.tmLanguage 2012-12-05 12:16:46.000000000 +0800
+++ /Users/vvtommy/CoffeeScript.tmLanguage 2012-12-05 12:15:51.000000000 +0800
@@ -262,7 +262,7 @@
</dict>
</dict>
<key>match</key>
- <string>([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=[^=]))(?!(\s*\(.*\))?\s*((=|-)&gt;)))</string>
+ <string>([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=))(?!(\s*\(.*\))?\s*((=|-)&gt;)))</string>
<key>name</key>
<string>variable.assignment.coffee</string>