Skip to content

Instantly share code, notes, and snippets.

Avatar
Building new teams at @justworkshr

Francis Gulotta reconbot

Building new teams at @justworkshr
View GitHub Profile
@reconbot
reconbot / .block
Last active Nov 30, 2017 — forked from mbostock/.block
Pie Chart
View .block
license: gpl-3.0
View validate-edges-errors.json
{
"Image": {
"3900284": [
"No validator for Image 'o:HasMedia': 1"
],
"3900287": [
"No validator for Image 'o:HasMedia': 1"
],
"3900290": [
"No validator for Image 'o:HasMedia': 1"
View validate-edges-errors.json
{
"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'"
View 720pmIds-createdAt.json
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,
View 720pmIds-createdAt.json
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,
View unhappy-hex-decode.js
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 Jul 25, 2017
Quick and dirty exif created at time to file modification time copy
View copy-exif-time.js
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)
View default ioredis 2x
★ 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 Dec 19, 2016
Trying to make aws4 work with got and elastic search
View es-client.js
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
View es-client.js
// 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 {