Skip to content

Instantly share code, notes, and snippets.


Jeff Ma Jeff2Ma

View GitHub Profile
View genesis_public_key
Jeff2Ma / gulpfile.js
Created Dec 29, 2016 — forked from tilap/gulpfile.js
Gulp reload on gulpfile.js change
View gulpfile.js
// Gulp restart when gulpfile is changed
var spawn = require('child_process').spawn;
gulp.task('gulp-autoreload', function() {
// Store current process if any
var p;'gulpfile.js', spawnChildren);
// Comment the line below if you start your server by yourslef anywhere else
Jeff2Ma /
Created Aug 11, 2016
Alfred Script Filter JSON format
# Alfred Script Filter JSON format
# This example demonstrates all fields available for populating results.
# For an in-depth explanation, use the (?) help button to the bottom left.
cat << EOB
{"items": [
Jeff2Ma /
Created May 18, 2016 — forked from aliencode/
handlebar 方法参考文档

handlebar 方法参考文档


Handlebars是JavaScript一个语义模板库,通过对view和data的分离来快速构建Web模板。它采用"Logic-less template"(无逻辑模版)的思路,在加载时被预编译,而不是到了客户端执行到代码时再去编译, 这样可以保证模板加载和运行的速度。Handlebars兼容Mustache,你可以在Handlebars中导入Mustache模板。


Handlebars的安装非常简单,你只需要从Github下载最新版本,你也可访问下面网址获取最新信息:。 目前handlebars.js已经被许多项目广泛使用了,handlebars是一个纯JS库,因此你可以像使用其他JS脚本一样用script标签来包含handlebars.js

Jeff2Ma / surge.conf
Created Dec 5, 2015
自用的surge config 文件,代码已经删除账号信息
View surge.conf
skip-proxy =,,, localhost, *.local,, *
bypass-tun =,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Jeff2Ma / Dorm-network.scpt
Last active Aug 19, 2019
Automatic proxy configuration set pac file with applescript & shell script
View Dorm-network.scpt
tell application "System Events"
tell network preferences
do shell script "scselect 'Dorm'"
do shell script "sudo networksetup -setairportpower AirPort on" user name "用户名" password "密码" with administrator privileges
do shell script "open /Applications/Shad**" user name “用户名" password "密码" with administrator privileges
end tell
end tell
Jeff2Ma /
Last active Aug 29, 2015
DangDang book contents txt catched by Python
# -*- coding: utf-8 -*-
#作者:Jeffma @
import urllib2
View auto-coupon-woo.php
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );
function apply_matched_coupons() {
global $woocommerce;
$get1 = 'getonech'; // your coupon code here
$get2 = 'gettwoch'; // your coupon code here
$get3 = 'getthreech'; // your coupon code here
$get4 = 'getfourch'; // your coupon code here
$get5 = 'getfivech'; // your coupon code here
View gist:0f8746b37c139f3cf4ef
* Plugin Name: WooCommerce - Show order IDs
* Plugin URI:
* Description: Adds a new columns to order list page to display order IDs
* Version: 1.0
* Author: Remi Corson
* Author URI:
* Requires at least: 3.5
* Tested up to: 3.5
View functions.php
// Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts.
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3);
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) {
global $woocommerce;
extract( $_POST );
if ( strcmp( $password, $password2 ) !== 0 ) {
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) );