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
# -*- 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=="))), "");
}
区号
010 北京 北京
020 广东 广州市
021 上海 上海
022 天津 天津
023 重庆 重庆
024 辽宁 沈阳市
025 江苏 南京市
027 湖北 武汉市
028 四川 眉山市
@vvtommy
vvtommy / URL parsing Regex.js
Created July 9, 2018 15:02 — forked from metafeather/URL parsing Regex.js
URL parsing regex.js
/*
A single regex to parse and breakup a full URL including query parameters and anchors e.g.
https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash
*/
Url.regex = /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/;
url: RegExp['$&'],
protocol: RegExp.$2,
host: RegExp.$3,
#!/bin/bash
# This file is accessible as https://install.direct/go.sh
# Original source is located at github.com/v2ray/v2ray-core/release/install-release.sh
# If not specify, default meaning of return value:
# 0: Success
# 1: System error
# 2: Application error
# 3: Network error
@vvtommy
vvtommy / PLACEHOLDER.MD
Last active August 15, 2022 13:41
PLACEHOLDER.profile

👽

@vvtommy
vvtommy / php.rb
Created April 11, 2023 03:42 — forked from jeroenoldenburger/php.rb
PHP 5.2 Formula for Homebrew
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
class Php < Formula
url 'http://ca2.php.net/distributions/php-5.2.17.tar.gz'
homepage ''
md5 '04d321d5aeb9d3a051233dbd24220ef1'