- git rebase
aeris' private branch for particle server.
Source repo: https://github.com/spark/spark-server
Postman Link: https://www.getpostman.com/collections/b76bb311a15ddc91579c
Domain: https://particle.aeris.cn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toCsvValue(theValue, sDelimiter) { | |
var t = typeof (theValue), output = ""; | |
if (typeof (sDelimiter) === "undefined" || sDelimiter === null) { | |
sDelimiter = '"'; | |
} | |
if (t === "undefined" || t === null) { | |
output = "" + ","; | |
} else if (t === "string") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var react = require('gulp-react'); | |
var bower = require('gulp-bower'); | |
var mainBowerFiles = require('main-bower-files'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var to5 = require('gulp-6to5'); | |
var es6ModuleTranspiler = require("gulp-es6-module-transpiler"); | |
var notify = require("node-notifier"); | |
var del = require("del"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func PipCmd(cmds []*exec.Cmd) (pipeLineOutput, collectedStandardError []byte, pipeLineError error) { | |
// Require at least one command | |
if len(cmds) < 1 { | |
return nil, nil, nil | |
} | |
// Collect the output from the command(s) | |
var output bytes.Buffer | |
var stderr bytes.Buffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |