Skip to content

Instantly share code, notes, and snippets.

View myconode's full-sized avatar

Daniel A. Christopher myconode

View GitHub Profile
@myconode
myconode / spawnSync_example.js
Created June 2, 2016 06:43
Example use of spawnSync
'use strict'
// https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options
const spawn = require('child_process').spawnSync
// object returned when process has completely exited
const child = spawn('which', ['node'] )
// view status
console.log( child.status )
@myconode
myconode / tessel-wifi-network-test.js
Last active September 16, 2015 03:20
Tessel Wifi & Network Test
// Tessel Wifi & Network Test
// Author: Daniel Christopher <thelostspore@gmail.com>
// Public Domain
//
// 1- Attempt to connect to Internet, retry as necessary
// 2- Make an HTTP GET
//
// Combines Tessel [wifi examples](http://start.tessel.io/wifi)
@myconode
myconode / tessel-delay.js
Last active September 16, 2015 03:24
Tessel Delay
// Tessel Delay
// Author: Daniel Christopher <thelostspore@gmail.com>
// Public Domain
//
// Halt script execution for given number of microseconds.
// Inspired by Arduino's built-in delay().
//
// Those already working with Javascript are likely to use setTimeout.
console.log("\nDoing something...");
@myconode
myconode / tessel-terminate.js
Last active September 27, 2015 23:54
Terminate a Tessel Script
// Terminate a Tessel Script
// Author: Daniel Christopher <thelostspore@gmail.com>
// Public Domain
//
// To stop a script running on the Tessel, simply `return` in the global scope
console.log("Hello");
delay(5000);
console.log("Goodbye");