Skip to content

Instantly share code, notes, and snippets.

⚡️
Building new teams at @justworkshr

Francis Gulotta reconbot

⚡️
Building new teams at @justworkshr
Block or report user

Report or block reconbot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@reconbot
reconbot / mouse-parser.js
Last active Aug 24, 2019
This parses the ms serial mouse wire protol into randomly named events.
View mouse-parser.js
const { Transform } = require('stream')
const debug = require('debug')('serialport/mouse-parser')
const StartByteMarkerByte = 0b01000000
const LeftMouseButtonByte = 0b00100000
const RightMouseButtonByte = 0b00010000
const isStart = byte => byte & StartByteMarkerByte
const DEFAULT_STATE = Object.freeze({
View log.log
### STARTED Filters for GitHub Actions 03:52:54Z
Pulling image: gcr.io/github-actions-images/action-runner:latest
latest: Pulling from github-actions-images/action-runner
cd784148e348: Already exists
23e2dcc28013: Pulling fs layer
1b231fbdf683: Pulling fs layer
bd89504cdd3c: Pulling fs layer
ad8707eb42ef: Pulling fs layer
ad8707eb42ef: Waiting
@reconbot
reconbot / .tesselinclude
Created Nov 26, 2018
My hanging js codee
View .tesselinclude
node_modules/blynk-library/certs/server.crt
@reconbot
reconbot / dumpmysql.js
Created Oct 19, 2018
This dumps every table in every mysql db to a file in ndjson format for loading into bigquery
View dumpmysql.js
const { pipe, transform } = require('bluestream')
const mysql = require('mysql')
const { createWriteStream } = require('fs')
const connection = mysql.createConnection({
socketPath: '/var/run/mysqld/mysqld.sock',
user: 'root',
password: 'root',
dateStrings: true,
})
View linux-list.ts
import childProcess from 'child_process'
import { Readline } from '@serialport/parser-readline'
import { PortInfo } from '@serialport/binding-abstract'
// get only serial port names
function checkPathOfDevice(path: string) {
return /(tty(S|ACM|USB|AMA|MFD|O)|rfcomm)/.test(path) && path
}
type PropName = 'DEVNAME' | 'ID_VENDOR_ENC' | 'ID_SERIAL_SHORT' | 'ID_VENDOR_ID' | 'ID_MODEL_ID' | 'DEVLINKS'
View perftest.js
const Benchmark = require('benchmark')
const Bl = require('./bl')
Bl.prototype.oldSlice = function slice (start, end) {
if (typeof start == 'number' && start < 0){
start += this.length
}
if (typeof end == 'number' && end < 0){
end += this.length
}
@reconbot
reconbot / blperftest.js
Last active Oct 9, 2018
perf test indexof
View blperftest.js
const Benchmark = require('benchmark')
const Bl = require('./')
const smallBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(8, 1)))
const largeBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(1024, 1)))
const mixedBuffers = new Bl(new Array(100).fill(1).map((val, i) => Buffer.alloc(i ** 2 % 1024, 1)))
const veryLargeBuffers = new Bl(new Array(100).fill(1).map(() => Buffer.alloc(1024 * 1024, 1)))
const notFindableSmall = Buffer.alloc(7, 0)
const notFindableMedium = Buffer.alloc(510, 0)
@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"
You can’t perform that action at this time.