Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# svn utils
# Author: Allex Wang ([email protected])
# GistID:
dir=`pwd`
source=$dir
cmd=$1
name=$2
# .bashrc
# Author: Allex Wang ([email protected])
# GistID: 317f2b8bca35ee951a8f
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
@allex
allex / build
Last active August 29, 2015 14:19
#!/bin/sh
# Toolkit script for git repos build and distribute release.
# Author: Allex Wang ([email protected])
# GistID: fbe05460d1f4005047ad
dir=`cd $(dirname $0); pwd -P`
source=$dir/source
[ -d $source ] || { echo >&2 "source dir not exists." && exit 404; }
#!/bin/sh
# Auto cleanup expried log files.
# Author: Allex Wang ([email protected])
# GistID: c487d6d8b2b52219a87b
# GistURL: https://gist.github.com/c487d6d8b2b52219a87b
log_dir=$1 # log files directory
expired_days=7 # log file expried days
<?php
/**
* Simple git hooks handler for web automate deployment.
*
* @author Allex Wang ([email protected])
* Last Modified: Wed Dec 24, 2014 03:49PM
* GistID: 433fa22c0af8be914c44
* GistURL: https://gist.github.com/433fa22c0af8be914c44
*/
@allex
allex / bbs.js
Last active August 29, 2015 14:20 — forked from TooTallNate/bbs.js
/**
* Requires node v0.7.7 or greater.
*
* To connect: $ curl -sSNT. localhost:8000
*/
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
@allex
allex / umd.js
Last active August 29, 2015 14:22
// GistID: 5dbaca696a4a95efa3d7
// GistURL: https://gist.github.com/allex/5dbaca696a4a95efa3d7
// @ref <https://raw.githubusercontent.com/umdjs/umd/master/returnExports.js>
// Uses Node, AMD or browser globals to create a module.
// If you want something that will work in other stricter CommonJS environments,
// or if you need to create a circular dependency, see commonJsStrict.js
// Defines a module "returnExports" that depends another module called "b".
@allex
allex / _inc.scss
Last active August 29, 2015 14:22
/*
Compass common consts and functions
@author Allex Wang ([email protected])
GistID: cc7227ac20bdf14f4613
GistURL: https://gist.github.com/allex/cc7227ac20bdf14f4613
*/
@import "compass/css3";
@import "compass/utilities";
@allex
allex / ssh.sh
Last active July 27, 2016 02:41
# Extends with specified shortcut completion with host prefix and default user
# Author: Allex Wang ([email protected])
# MIT Licensed
# GistID: 0f844bbe583a1e40548d
# GistURL: https://gist.github.com/allex/0f844bbe583a1e40548d
ssh() {
local user=
local host=$1
local m=`grep -Po '\w+@\w+' <<< "$host"`
if [ "$m" ]; then
@allex
allex / pngcrush.sh
Last active February 26, 2016 06:20
#!/bin/sh
# Usage: pngcrush.sh <src_dir> [out_dir]
#
# GistID: bb5f758dba3ae18176b4
# GistURL: https://gist.github.com/bb5f758dba3ae18176b4
# Author: Allex Wang ([email protected])
input="${1%/}"
out="${2%/}"