Skip to content

Instantly share code, notes, and snippets.

Avatar
Building new teams at @Shopify

Francis Gulotta reconbot

Building new teams at @Shopify
View GitHub Profile
@reconbot
reconbot / check-download-stats.js
Last active May 6, 2018
A small script to query github releases for download counts, summarizing them by ia32 or not in their file name. Working on providing data for the decision to drop ia32 support for node 10 https://github.com/nodejs/build/issues/885#issuecomment-386893606
View check-download-stats.js
#!/usr/bin/env node
const r2 = require('r2');
const API_HOST = 'https://api.github.com/graphql';
const PUBLIC_READ_TOKEN = 'XXX'; // (only needs public repo scope)
const query = `
query {
repository(owner: "node-serialport", name: "node-serialport") {
nameWithOwner
owner {
@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