Skip to content

Instantly share code, notes, and snippets.

Josh andjosh

Block or report user

Report or block andjosh

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
View keybase.md

Keybase proof

I hereby claim:

  • I am andjosh on github.
  • I am andjosh (https://keybase.io/andjosh) on keybase.
  • I have a public key ASCYoiQSBrKhv6hT6qxy7W3-J9RUgPJx9ZLweDwWUpWHGwo

To claim this, I am signing this object:

View dayone2-bear-import.js
var fs = require('fs');
var child_process = require('child_process');
var main = () => {
var excludedFileNames = /\| Hacker News/;
var journal = 'worklog';
fs.readdirSync('.')
.filter(f => f.match(/\.md$/))
.map(f => {
return Object.assign(fs.statSync(f), {
View game.js
var readline = require('readline');
var jumpEmpty = '▖▘▝'.split('');
var block = '\x1b[31m▖\x1b[0m';
var space = ' ';
var Game = function(options){
if(!(this instanceof Game)) return new Game(options)
options = options || {};
this.width = options.width || 50;
View script.gnuplot
# Let's output to a jpeg file
set terminal jpeg size 500,500
# This sets the aspect ratio of the graph
set size 1, 1
# The file we'll write to
set output "timeseries-narro-10.jpg"
# The graph title
set title "Benchmark testing 1000(10c)"
# Where to place the legend/key
set key left top
View middleware-perf-throttle.js
import perf from '../lib/perf.js';
const THRESHOLD = 83; // ~ 5 animation frames
const slowLog = (action, duration) => {
(requestAnimationFrame || setTimeout)(() => {
console.warn(`[perf] action ${action.type} took ${duration.toFixed(2)}ms`, {
mean: perf.mean(action.type),
sdev: perf.sdev(action.type),
samples: perf.getEntriesByName(action.type).length,
});
View middleware-perf.js
import perf from '../lib/perf.js';
const THRESHOLD = 83; // ~ 5 animation frames
const perfMiddleware = store => next => action => {
perf.start(action.type);
let result = next(action);
perf.end(action.type);
if (perf.duration(action.type) > THRESHOLD) {
console.warn(`[perf] action ${action.type} took ${perf.duration(action.type).toFixed(2)}ms`, {
View perf.js
import log from './log.js';
import __ from './console.sparkline.js';
const debug = log('[perf]');
export const hasPerf = typeof self !== 'undefined' && self.performance;
export const hasPerfNow = hasPerf && self.performance.now;
export const hasPerfMark = hasPerf && self.performance.mark;
let marks = {};
let measures = {};
View keybase.md

Keybase proof

I hereby claim:

  • I am andjosh on github.
  • I am jbckmn (https://keybase.io/jbckmn) on keybase.
  • I have a public key ASCqc2nZ1MIOYr3iys0lhzIORv0-z_vq-zEsdnWK52W4rQo

To claim this, I am signing this object:

View rss_feeds
https://jvns.ca/atom.xml
http://sonniesedge.co.uk/feed.xml
https://eev.ee/feeds/blog.atom.xml
http://feeds.feedburner.com/turkeltaub
https://marco.org/rss2
https://daringfireball.net/feeds/main
http://www.evanmiller.org/news.xml
http://feeds.feedburner.com/codinghorror
http://feeds.feedburner.com/HighScalability
http://www.overcomingbias.com/feed
@andjosh
andjosh / heroku_multi
Last active Jul 24, 2017
Run the same command on multiple Heroku apps via heroku cli
View heroku_multi
#!/bin/bash
#
# A command to run a heroku CLI command for multiple apps
#
# USAGE
# $ heroku_multi config:set FOO=bar -a app-1 two-app three-apps
#
i=0
position=0
You can’t perform that action at this time.