Skip to content

Instantly share code, notes, and snippets.

@vmlinz
vmlinz / numToRoman.js
Created September 13, 2015 10:28
Convert numbers to roman notation
function convert(num) {
var romanSigns = ['I', 'V', 'X', 'L', 'C', 'D', 'M'];
var numString = num.toString();
var numToRoman = function(n, sl, sm, sh) {
var syms = [];
syms.push('', sl, sl+sl, sl+sl+sl, sl+sm, sm, sm+sl, sm+sl+sl, sm+sl+sl+sl, sl + sh);
return syms[n];
};
@vmlinz
vmlinz / where.js
Created September 15, 2015 04:47
freecodecamp_where.js
function where(collection, source) {
return collection.filter(function (v) {
for (var i in source) {
if (!(v.hasOwnProperty(i) && (v[i] === source[i]))) {
return false;
}
}
return true;
});
@vmlinz
vmlinz / wporg-theme-developer-handbook-intro.md
Last active September 21, 2015 14:12 — forked from philiparthurmoore/wporg-theme-developer-handbook-intro.md
The WordPress.org Theme Developer Handbook Introduction

[Note: The style that follows is what I would consider "somewhat conversational American English". Please feel free to edit at will to fit the overall needs of the Theme Developer Handbook introduction.]

[Note: It might make sense to put the "Your First Theme" section just underneath the "Getting Started with WordPress Theme Development" introduction text to give new theme developers an immediate sense of accomplishment for making their first theme.]

Getting Started with WordPress Theme Development

[TODO: Introduction Text]

The GPL

@vmlinz
vmlinz / wordpress-dev.md
Last active March 15, 2016 12:47
Resources to learn wordpress themes development
@vmlinz
vmlinz / README.md
Created October 8, 2015 13:35
LNMP + docker compose split

Docker Compose up to three containers - Bolt.cm example

Make sure to check out ross's approach!

Docker let's you overcome hypervisors. So let's check it out:

## docker-compose.yml
php:
  image: doerty/fpm  # see below
@vmlinz
vmlinz / obfsproxy_for_shadowsocks.md
Created October 14, 2015 10:18
Obfsproxy client command

Obfsproxy command for shadowsocks

Shadowsoks is somewhat not stable here, and it looks like the gfw detects it and prevent my ip from connecting the remote shadowsocks server. Once I change my external IP, the connection is good again.

Command

obfsproxy scramblesuit --password=FANGBINXINGFUCKYOURMOTHERSASS444 --dest=106.186.123.157:48080 client 127.0.0.1:48080

@vmlinz
vmlinz / opkg-upgrade.sh
Created October 14, 2015 17:42
opkg upgrade
!/bin/sh
opkg update
for ipk in $(opkg list-upgradable | awk '$1!~/^kmod|^Multiple/{print $1}'); do
opkg upgrade $ipk
done
@vmlinz
vmlinz / ss-mon.sh
Created October 14, 2015 17:43
Shadowsocks network monitor
#!/bin/sh
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
wget -4 --spider --quiet --tries=1 --timeout=3 www.google.co.jp
if [ "$?" == "0" ]; then
echo '['$LOGTIME'] No Problem.'
exit 0
else
wget -4 --spider --quiet --tries=1 --timeout=3 www.baidu.com
if [ "$?" == "0" ]; then
@vmlinz
vmlinz / speed.sh
Created October 14, 2015 18:37
network speed test
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
@vmlinz
vmlinz / gist:28f01682ed46c020568b
Created October 23, 2015 14:06 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port