Skip to content

Instantly share code, notes, and snippets.

View zachcr's full-sized avatar
🏠
Working from home

Zach Yang zachcr

🏠
Working from home
View GitHub Profile
@zachcr
zachcr / gulpfile.js
Last active August 29, 2015 14:18 — forked from insin/gulpfile.js
/*
gulpfile from one of my React applications which has a gulp --production build
set up.
Assumptions:
1. All your own .js/.jsx modules are somewhere under ./src, have unique
filenames and use Node.js-style requires WITHOUT any path information, just
the name of another module somewhere under ./src
function get(uri) {
return http(uri,'GET');
}
function post(uri,data) {
if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) {
var params = [];
for(var p in data) {
if(data[p] instanceof Array) {
for(var i = 0; i < data[p].length; i++) {
params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][i]);
@zachcr
zachcr / gh_hook.php
Created October 31, 2013 15:59 — forked from webjay/gh_hook.php
<?php
//error_reporting(E_ALL);
ignore_user_abort(true);
function syscall ($cmd, $cwd) {
$descriptorspec = array(
1 => array('pipe', 'w') // stdout is a pipe that the child will write to
);
$resource = proc_open($cmd, $descriptorspec, $pipes, $cwd);