Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@tatsuhiro-t
tatsuhiro-t / bench-backend.conf
Last active August 4, 2017 17:24
HTTP/2 server benchmark Jan 2015
listen: 3001
http2-max-concurrent-requests-per-connection: 1024
max-connections: 15000
num-threads: 1
hosts:
localhost:
paths:
/:
file.dir: /path/to/htdocs
@chadsmith
chadsmith / FaviconAwesome.js
Last active January 11, 2018 19:03
FontAwesome in Favicons
(function() {
var FaviconAwesome = function(icon, color, bg) {
'use strict';
var
container = document.createElement('div'),
span = document.createElement('span'),
body = document.body,
content,
canvas = document.createElement('canvas'),
getContext = function(w) {
@naholyr
naholyr / Makefile
Last active March 6, 2018 17:02
browserify-friendly Makefile
# Main entry point
SOURCE = src/app.js
# The dependencies (other than node_modules/**)
LIBS = $(shell ls src/lib/*.js src/components/*.js)
# The target
TARGET = build/app.js
# Compilation flags
@ticklemynausea
ticklemynausea / Nokia_5110_LCD_GameOfLife.ino
Last active December 26, 2017 10:57
Nokia_5110_LCD_GameOfLife
// Nokia 5110 LCD-Display (SIZE_HxSIZE_V Bildpunkte)
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#define LCD_WIDTH 84
#define LCD_HEIGHT 48
#define LCD_HEIGHT8 (LCD_HEIGHT >> 3)
#define map(i, j) (i + LCD_WIDTH*j)
@ruudud
ruudud / instructions.md
Created October 8, 2014 14:30
ios-webkit-debug-proxy on Ubuntu 14.04
$ mkdir ~/ios-proxy && cd $_
$ git clone https://github.com/google/ios-webkit-debug-proxy
$ sudo apt-get install \
      autoconf automake \
      libusb-dev libusb-1.0-0-dev \
      libplist-dev libplist++-dev \
      usbmuxd \
      libimobiledevice-dev
$ wget http://www.libimobiledevice.org/downloads/libplist-1.11.tar.bz2
@staltz
staltz / introrx.md
Last active August 2, 2025 18:25
The introduction to Reactive Programming you've been missing
@jaz303
jaz303 / Makefile
Last active October 20, 2016 15:19
Makefile for browserify workflow
MODULE = # insert module name here
EXPORT = $(MODULE)
BUILD_DIR = build
BUNDLE = $(BUILD_DIR)/$(MODULE).js
DEMO_BUNDLE = demo/bundle.js
DEMO_ENTRY = demo/main.js
ENTRY = index.js
SRC = $(ENTRY)
@kriskowal
kriskowal / promise-inspector-protocol.md
Last active August 29, 2015 13:56
Promise Inspector Protocol

One of the features of promises, in the Promises/A+ sense, is that they capture thrown exceptions so they can be handled asynchronously. This has the negative consequence that it is possible for an error to be silently ignored forever. There is a long list of measures that can mitigate this problem, but the real solution is to use a Promise Inspector.

The JavaScript console is not satisfying. The trouble with a rejected promise is that it might not be later connected to a promise chain that would handle recover from or surface the issue. The naïve solution would be to log every exception to the console, but then it becomes difficult to distinguish errors that have been handled programmatically from errors that never will be. Ideally, the promise inspector would show rejected promises until they are handled and then hide them. That way, if a program reaches an obviously stable or idle state and a rejection remains on the console, it is very likely due to a programmer’s error.

There is a less obvious class of

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results