Skip to content

Instantly share code, notes, and snippets.

@maple-leaf
maple-leaf / README.md
Created April 25, 2017 12:48 — forked from githubutilities/README.md
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@maple-leaf
maple-leaf / watermark-a-pic.sh
Last active October 18, 2016 08:09
use imagick to watermark a pic with arguments(width, height, x, y, angle, fontSize, align, text, source and target)
#!bin/bash
# author: fengye
# usage:
# sh add-price.sh --width 96 --height 38.4 --fontSize 32 --text "123" --degree -43.47370302872064 --align west -x 16.823171983548807 -y 30.375512919950317 --source 800-mark.jpg --target 800-price2.jpg
while [[ $# -gt 1 ]]
do
key="$1"
Axure RP 7.0注册码
用户名:axureuser
序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+tqEV4LG
@maple-leaf
maple-leaf / shadowsocks_ssh
Created July 27, 2016 01:46 — forked from gnepud/shadowsocks_ssh
shadowsocks / ssh proxy
----- shadowsocks ------
server
easy_install pip
pip install shadowsocks
vi /etc/shadowsocks.json
{
"server":"server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
git log --name-only --date=short --pretty=format:"%Cblue%h %C(yellow)%aN %Creset%aI %Cgreen%s"
@maple-leaf
maple-leaf / modifyJson.js
Created August 7, 2015 09:07
modify json value at deep position by passing path string
a={b:{c:1, e: {f:1}},d:2}
b = function(ks) {
var x = [];
ks.forEach(function(k) {
if(x.length) {
x.push(x[x.length - 1][k]);
} else {
x.push(a[k]);
}
@maple-leaf
maple-leaf / groupBy
Last active August 29, 2015 14:08
groupBy
var x = [
{date:"2013-01-01",sales:99},{date:"2013-01-02",sales:99},{date:"2013-01-03",sales:99},{date:"2013-01-04",sales:99},
{date:"2013-02-01",sales:99},{date:"2013-02-02",sales:99},{date:"2013-02-03",sales:99},{date:"2013-02-04",sales:99},
{date:"2013-03-01",sales:99},{date:"2013-03-02",sales:98},{date:"2013-03-03",sales:99},{date:"2013-03-04",sales:99},
{date:"2013-04-01",sales:99},{date:"2013-04-02",sales:99},{date:"2013-04-03",sales:99},{date:"2013-04-04",sales:99},
{date:"2013-05-01",sales:98},{date:"2013-05-02",sales:99},{date:"2013-05-03",sales:99},{date:"2013-05-04",sales:99},
];
function groupBy(arr, property, cb) {
var newArr = [], group = {}, k;
/*!
* jquery.addrule.js 0.0.2 - https://gist.github.com/yckart/5563717/
* Add css-rules to an existing stylesheet.
*
* @see http://stackoverflow.com/a/16507264/1250044
*
* Copyright (c) 2013 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/11/23
**/
@maple-leaf
maple-leaf / config.js
Last active January 3, 2016 05:19
RequireJS config
/*jslint browser: true, devel: true */
(function () {
'use strict';
requirejs.config({
baseUrl: ".",
paths: {
// libraries path
"json": "vendor/json2",
@maple-leaf
maple-leaf / styleRegSpec.js
Created December 12, 2013 06:40
All style matching to target element(with class or id or not)
/*
* styleRegTest.js
* Copyright (C) 2013 <@TJFDFS>
*
* Distributed under terms of the MIT license.
*/
describe("style regular matching test", function(){
// Test "div#abc.read-more"
var pattern = "((div)+|(\\.read-more)+|(#abc)+|(:\\w+)+)\\s*(((?=,)(.*))|$)";