Skip to content

Instantly share code, notes, and snippets.

Avatar
🐵

Austin Lee lizheming

🐵
View GitHub Profile
@messense
messense / shadowsocks-on-openwrt.md
Last active Jul 17, 2019
shadowsocks on openwrt
View shadowsocks-on-openwrt.md

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

anonymous
anonymous / hash.php
Created Mar 27, 2013
View hash.php
<?php
/**
* 加密 hash,生成发送给用户的 hash 字符串
*
* @param array $hash_data
* @param string $hash_key
* @return string
*/
function encode_hash($hash_data, $hash_key = false)
@brettz9
brettz9 / HTMLSelectElement.prototype.selectedOptions.js
Last active Jul 25, 2019
selectedOptions shim (multiple select) with IE8 support
View HTMLSelectElement.prototype.selectedOptions.js
/**
* Polyfill for "fixing" IE's lack of support (IE < 9) for applying slice
* on host objects like NamedNodeMap, NodeList, and HTMLCollection
* (technically, since host objects are implementation-dependent,
* IE doesn't need to work this way). Also works on strings,
* fixes IE to allow an explicit undefined for the 2nd argument
* (as in Firefox), and prevents errors when called on other
* DOM objects.
* @license MIT, GPL, do whatever you want
-* @see https://gist.github.com/brettz9/6093105
@remy
remy / audiosprite.js
Created Dec 23, 2010
An example of how an audio sprite can be used (includes fixes for iOS)
View audiosprite.js
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
You can’t perform that action at this time.