This file contains 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 failing() { | |
return new Promise((resolve, reject) => { | |
setTimeout(function() { | |
reject(new Error("failed")); | |
},10); | |
}); | |
} |
This file contains 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
"use strict"; | |
/** | |
* convert blueprint to a postman collection | |
* pretty much a dirty port of https://github.com/pixelfusion/blueman | |
*/ | |
var fs = require("fs"), | |
path = require("path"), | |
inspect = require("util").inspect, |
This file contains 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
"use strict"; | |
const performance = window.performance; | |
function streamedPolling(baseUrl, onItem) { | |
return fetch("https://" + baseUrl + "/streamed-polling") | |
.then(response => { | |
const decoder = new TextDecoder(); | |
const reader = response.body.getReader(); | |
let buffer = ""; |
This file contains 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
"use strict"; | |
//hardware modules | |
const Raspi = require("raspi-io"); | |
const five = require("johnny-five"); | |
const board = new five.Board({ | |
io: new Raspi() | |
}); | |
//networking modules |
This file contains 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
# set default Maildir | |
MAILDIR="$HOME/Maildir" | |
# check if we're called from a .qmail-EXT instead of .qmail | |
import EXT | |
if ( $EXT ) | |
{ | |
# does a vmailmgr user named $EXT exist? if yes, deliver mail to his Maildir instead | |
CHECKMAILDIR = `dumpvuser $EXT | grep '^Directory' | awk '{ print $2 }'` | |
if ( $CHECKMAILDIR ) |
This file contains 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
//PIN 12 (BCM18) | |
const ws281x = require("rpi-ws281x-native"); | |
const numLeds = 10; | |
ws281x.init(numLeds); | |
let pixelData = new Uint32Array(numLeds); | |
pixelData = [ | |
[255,0,0], |
This file contains 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 appendObject(params, obj, prefix) { | |
for (let key of Object.keys(obj)) { | |
if (typeof obj[key] === "object") { | |
appendObject(params, obj[key], prefix ? `${prefix}[${key}]` : key); | |
} else { | |
params.append(prefix ? `${prefix}[${key}]` : key, obj[key]); | |
} | |
} | |
return params; |
This file contains 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
Hello2(); |
This file contains 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 Kt=Object.create;var lt=Object.defineProperty,zt=Object.defineProperties,Yt=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,ee=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var Pt=(t,o,r)=>o in t?lt(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,k=(t,o)=>{for(var r in o||(o={}))At.call(o,r)&&Pt(t,r,o[r]);if(kt)for(var r of kt(o))ne.call(o,r)&&Pt(t,r,o[r]);return t},H=(t,o)=>zt(t,Qt(o));var re=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var oe=(t,o,r,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of te(o))!At.call(t,a)&&a!==r&<(t,a,{get:()=>o[a],enumerable:!(i=Yt(o,a))||i.enumerable});return t};var ie=(t,o,r)=>(r=t!=null?Kt(ee(t)):{},oe(o||!t||!t.__esModule?lt(r,"default",{value:t,enumerable:!0}):r,t));var Mt=(t,o,r)=>{if(!o.has(t))throw TypeError("Cannot "+r)};var T=(t,o,r)=>(Mt(t,o,"read from private field"),r?r.call(t):o |
OlderNewer