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 food = ["kiwi","bananas"], | |
poo = [], | |
eat = function(fruit) { | |
var transformed = (function(fruit) { | |
return fruit + " shit"; | |
})(fruit); | |
return transformed; | |
}; | |
for (var i = food.length - 1; i >= 0; 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
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8976, | |
throttle = 2000; // ms | |
http.createServer(function(request, response) { |
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 Collection = function () { | |
return { | |
db: [], | |
add: function (o) { | |
if (typeof(o.uid) === 'undefined') { | |
throw 'error: object has no uid'; | |
} | |
if (this.get(o.uid) === false) { | |
this.db.push(o); | |
} |
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
#include<stdio.h> | |
main() | |
{ | |
printf("Hello World"); | |
} |
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
navigator.mediaDevices.getUserMedia ({ | |
"audio": true, | |
"video": { | |
width: 640, | |
height: 360, | |
facingMode: "user" | |
} | |
}).then( | |
gotStream | |
).catch( |
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
mySignaller.signalMessage({ | |
"ice": iceGathr.getLocalParameters(), | |
"dtls": dtlsTr.getLocalParameters(), | |
"recvAudioCaps": recvAudioCaps, | |
"recvVideoCaps": recvVideoCaps, | |
"sendAudioCaps": sendAudioCaps, | |
"sendVideoCaps": sendVideoCaps | |
}); |
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
Verifying that +gaspard is my blockchain ID. https://onename.com/gaspard |
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
#include <Wire.h> | |
#include <Adafruit_MotorShield.h> | |
#include "utility/Adafruit_MS_PWMServoDriver.h" | |
// these constants won't change: | |
const int pinTrig = 13; // trigger sound with digital pin 13 (yellow) | |
const int pinEcho = 12; // green | |
const int pinLed = 10; // orange | |
const int threshold = 100; // threshold value to decide when the detected sound is a knock or not |
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
// doc | |
// https://westus.dev.cognitive.microsoft.com/docs/services/565d6516778daf15800928d5/operations/565d6517778daf0978c45e35 | |
const fs = require('fs'); | |
const request = require('request'); // use npm i request | |
const create = (fileUrl) => { | |
return new Promise(function (resolve, reject) { | |
request({ | |
method: 'post', |
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
#!/usr/bin/env bash | |
sleep_date() { | |
echo "starting $1 at $(date)"; | |
sleep $1; | |
echo "ending $1 at $(date)"; | |
} | |
echo "starting all $(date)"; | |
sleep_date 10 & |