Skip to content

Instantly share code, notes, and snippets.

View reconbot's full-sized avatar
🏴‍☠️
Building at @github

Francis Gulotta reconbot

🏴‍☠️
Building at @github
View GitHub Profile
{
"FeatureZone": {
"2481425": [
"count === 1 failed with 2 for 's:HasClip'"
],
"3077671": [
"count === 1 failed with 0 for 's:HasClip'"
],
"3206466": [
"count === 1 failed with 2 for 's:HasClip'"
This file has been truncated, but you can view the full file.
{
"2": 1446852245925,
"3": 1446852245925,
"4": 1446852245924,
"5": 1446852245924,
"6": 1446852245924,
"7": 1446852245924,
"8": 1446852245924,
"9": 1446852245924,
"10": 1446852245923,
This file has been truncated, but you can view the full file.
{
"2": 1446852245925,
"3": 1446852245925,
"4": 1446852245924,
"5": 1446852245924,
"6": 1446852245924,
"7": 1446852245924,
"8": 1446852245924,
"9": 1446852245924,
"10": 1446852245923,
function decodeHexEscape(str) {
return str.replace(/\\x([a-fA-F0-9]{2})/g, (a, b) => {
return String.fromCharCode(parseInt(b, 16));
});
}
@reconbot
reconbot / copy-exif-time.js
Created July 25, 2017 03:40
Quick and dirty exif created at time to file modification time copy
const fs = require('fs')
const Promise = require('bluebird')
const moment = require('moment')
const { promisify } = require('util')
const touch = promisify(require('touch'))
var getExifData = promisify(require('exif').ExifImage)
const readdir = promisify(fs.readdir)
const stat = promisify(fs.stat)
★ thunk-redis git:(master) ✗ node benchmark
redis(redis): node_redis OK
redis(thunk-redis):thunk-redis OK
redis(ioredis): ioRedis OK
Bench start:(100000)
PING concurrency(full thread):
redis(redis): 1058ms 94517ops/sec 100%
redis(thunk-redis): 1117ms 89525ops/sec 94.7%
@reconbot
reconbot / es-client.js
Last active December 19, 2016 03:46
Trying to make aws4 work with got and elastic search
import AWS from 'aws-sdk'
import aws4 from 'aws4'
import bole from 'bole'
import got from 'got'
import Promise from 'bluebird'
import config from './config'
const logger = bole('es-client')
const { region, host } = config
// This is what elastic search wants for promises, bluebird says it's horrible
// https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html#config-defer
// http://bluebirdjs.com/docs/api/deferred-migration.html
function defer () {
let resolve, reject
var promise = new Promise(function makeDefer () {
resolve = arguments[0]
reject = arguments[1]
})
return {
'use strict';
var SerialPort = require('./');
var port = process.env.TEST_PORT;
if (!port) {
console.error('Please pass TEST_PORT environment variable');
process.exit(1);
}
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
// Create an Led on pin 13 and strobe it on/off
var led = new five.Led(13)
// Optionally set the speed; defaults to 100ms
led.strobe(100);
});