Skip to content

Instantly share code, notes, and snippets.

@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@darkhelmet
darkhelmet / balance.go
Created June 16, 2013 05:05
Simple TCP load balancer in Go.
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
@NV
NV / Readme.md
Last active May 28, 2023 20:42
Prepend the debugger statement to a function as easy as stopBefore('Element.prototype.removeChild'). Works in Chrome DevTools and Safari Inspector, doesn’t work in Firebug‘s and Firefox Developer Tools‘ console (I don’t know why). Works as a standalone script everywhere.

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@yomotsu
yomotsu / getDeltaAngle.js
Last active May 11, 2023 14:53
Calculates the shortest difference between two given angles given in radians, in JS
// http://docs.unity3d.com/ja/current/ScriptReference/Mathf.DeltaAngle.html
var getDeltaAngle = function () {
var TAU = 2 * Math.PI;
var mod = function ( a, n ) { return ( a % n + n ) % n; }
return function ( current, target ) {
var a = mod( ( current - target ), TAU );
@cvrebert
cvrebert / css_regression_testing.md
Last active May 9, 2023 12:13
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@morganrallen
morganrallen / _README.md
Last active January 15, 2023 19:41
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@neilj
neilj / window-controller.js
Last active November 4, 2022 21:41
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@eh-dub
eh-dub / index.d.ts
Last active June 10, 2021 16:45
Sapper + Svelte + Typescript
// in $PROJECT_ROOT/typings/@sapper
declare module '@sapper/app' {
// from sapper/runtime/src/app/types.ts
// sapper doesn't export its types yet
interface Redirect {
statusCode: number
location: string
}
// end
#!/bin/sh
set -e
set -x
cd $HOME
rm -rf netstack.bare netstack
git clone --bare $HOME/gvisor netstack.bare
cd netstack.bare