Skip to content

Instantly share code, notes, and snippets.

View chopfitzroy's full-sized avatar
👽
What are we if not plural?

Otis Sutton chopfitzroy

👽
What are we if not plural?
View GitHub Profile
@robertlong
robertlong / json2ts.js
Created March 20, 2017 19:43
JSON Schema to Typescript with External References
#!/usr/bin/env node
const path = require('path');
const fs = require('fs');
const RefParser = require('json-schema-ref-parser');
const Generator = require('json-schema-to-typescript');
const schemaPath = process.argv[2];
const outputPath = process.argv[3];
@itod
itod / split_keyboards.md
Last active June 18, 2025 03:13
Every "split" mechanical keyboard currently being sold that I know of
anonymous
anonymous / powermenu.sh
Created October 7, 2016 13:20
my exit menu
#!/bin/bash
PANELFG='#585858'
PANELBG='#DD181818'
PANELNAME='powermenupanel'
SIZE=$(xrandr -q |grep '*+'|awk '{print $1}')
WIDTH=360 # this is *so* hardcoded. please adapt to your own needs!
FONTSIZE=10
HEIGHT=$(echo $FONTSIZE + 20|bc)
XPADDING=$(echo $(echo $SIZE | cut -d'x' -f1) / 2 - $WIDTH / 2|bc)
@facholi
facholi / index.js
Created September 16, 2016 20:35
Node.js script to runs on AWS Lambda. Converts the PDF pages to JPG images
var async = require("async");
var AWS = require("aws-sdk");
var gm = require("gm").subClass({imageMagick: true});
var fs = require("fs");
var mktemp = require("mktemp");
var PAGE_WIDTH = 1300,
PAGE_HEIGHT = 1300;
var utils = {
@dfrankland
dfrankland / install-hyperterm.sh
Last active August 25, 2016 20:58
Bash script to install HyperTerm (https://hyperterm.org). You'll need to run this script with `sudo`.
#! /bin/bash
if [ -n "$SUDO_USER" ]
then
CURRENT_USER=$SUDO_USER
else
CURRENT_USER=$USER
fi
LATEST_VERSION=$(curl -s "https://github.com/zeit/hyperterm/releases/latest" | sed -E 's/^.*?tag\/v(.*?)".*?$/\1/g')
@Rich-Harris
Rich-Harris / service-workers.md
Last active June 23, 2025 19:36
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char font[] = "Tamsyn:pixelsize=16";
static int borderpx = 2;
#define histsize 65000
// where `db` is a `Firebase` ref
export function checkIfUserExists(authData) {
return db
.child('users')
.child(authData.uid)
.once('value')
.then(dataSnapshot => {
return Promise.resolve({
authData,
@sagalbot
sagalbot / karma.conf.js
Created April 29, 2016 19:28
Karma Config for Webpack/Vue/Jasmine
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
files: ['test/**/*.js'],
reporters: ['spec'],
preprocessors: {
'test/*.js': ['webpack']
},
singleRun: true,
@chris-jamieson
chris-jamieson / setup.md
Created April 19, 2016 15:43
Set up Franz for Ubuntu
  • Download Franz for your distribution from MeetFranz.com
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz
  • (optional) wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franz
  • (optional) sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]
Name=Franz
Comment=