Skip to content

Instantly share code, notes, and snippets.

@allex
allex / audio.js
Last active August 29, 2015 14:23
/**
* Media 资源管理模块
*
* <pre><code>
* HTML
* ----
* <div class='page-audio hide' data-src="./bg.mp4">
* <div class="btn_audio">
* <strong class='txt_audio z-hide'>关闭</strong><span class='audio_open'></span>
* </div>
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@allex
allex / KVCache.php
Last active September 14, 2015 10:05
<?php
namespace app\helpers;
/**
* A simple k/v cache manager based on file system.
*
* @author Allex Wang ([email protected])
*
* GistID: b3793353690a89452c7f
* GistURL: https://gist.github.com/allex/b3793353690a89452c7f
; Default php-fpm.conf by Allex Wang ([email protected])
;
; Nginx integrate with php-fpm
;
; ```conf
; location ~ \.(php|php5)$ {
; fastcgi_split_path_info ^(.+\.php)(/.+)$;
; if (!-f $document_root$fastcgi_script_name) {
; return 404;
; }
#!/bin/env node
/**
* A simple proxy for http request forwards.
*
* @author Allex Wang ([email protected])
*
* GistID: 5b70db879e1938ee360e
* GistURL: https://gist.github.com/5b70db879e1938ee360e
*/
#!/usr/bin/env bash
# Distribute git project to remote server by SSH
# Author: Allex Wang ([email protected])
# GistID: 83957b884c8d9566f4ad
# GistURL: https://gist.github.com/83957b884c8d9566f4ad
branch=release
commit=
server_list=
#!/bin/sh -e
# ================================================
# Description: update static resource revision
# Last Modified: Thu Jul 16, 2015 03:32PM
# Author: Allex Wang ([email protected])
# GistID: c0a3a6d302996ffa2f1d
# GistURL: https://gist.github.com/c0a3a6d302996ffa2f1d
# ================================================
#!/bin/sh
# ================================================
# Description: A simple repl for cluster intercept
# Last Modified: Tue Jan 12, 2016 06:36PM
# Author: Allex Wang ([email protected])
# GistID: 6c244e8510eb3a9a30fc
# GistURL: https://gist.github.com/6c244e8510eb3a9a30fc
# ================================================
<?php
# GistID: 61f69d0a928d750a254a
$dir = __DIR__;
$update_sh = "$dir/release.sh";
$handle = popen($update_sh, 'r');
if (ob_get_level() == 0)
ob_start();
if (is_resource($handle)) {
while (!feof($handle)) {
$buffer = fgets($handle, 2);
@allex
allex / form.js
Last active August 29, 2015 14:25
/**
* Form utilities for serialize/desrialize.
*
* GistID: fe0b2b4c1ffeacfe16a5
* GistURL: https://gist.github.com/fe0b2b4c1ffeacfe16a5
*
* @author Allex Wang ([email protected])
*
* Usage:
*