Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

vvtommy

🎯
Focusing
View GitHub Profile
View gist:a2cd821c9e23d6d67294
# -*- 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
View gist:8e959e795da78f2cf561
# -*- 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 Nov 27, 2014
阿里云 trusty apt source.list
View gist:88418fe220920a8f7167
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 Jun 30, 2015
Nginx User ID Decoder for PHP
View nginxUserIdDecoder.php
function nginxUserIdDecoder($userIdInCookie){
return join(array_map(function($i){return strtoupper(dechex($i));},unpack("L*", base64_decode("wKjHwFWR6Ka5RHopAwMNAg=="))), "");
}
@vvtommy
vvtommy / LICENSE.txt
Created Jan 21, 2012 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
View LICENSE.txt
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 Mar 1, 2012
evernote error log on Chrome 19.0.1055.1 dev-m (Windows)
View 3-1-2012_14_39_51.log
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 Nov 30, 2012
测试IE下一个错误
View document_write_foo.js
document.write('foo');
@vvtommy
vvtommy / openvpn_pam_initialie_tables.sql
Created Dec 2, 2012
pam_mysql进行OpenVPN认证的表结构
View openvpn_pam_initialie_tables.sql
-- 创建数据库
CREATE DATABASE openvpn;
-- 切换数据库
USE openvpn;
-- 创建用户,用户名openvpn,密码openvpn(可自行设定)
GRANT ALL ON openvpn.* TO 'openvpn'@'localhost' IDENTIFIED BY 'openvpn';
-- 创建用户数据表
@vvtommy
vvtommy / gist_usage_example.js
Created Dec 3, 2012
介绍Wordpress Gist插件所做的实例
View gist_usage_example.js
/**
* 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 Dec 5, 2012
CoffeeScript-Sublime-Plugin 0.5.3 syntax highlighting patch
View CoffeeScript_Sublime_Plugin.0.5.3.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>