Skip to content

Instantly share code, notes, and snippets.

View abaines-phx's full-sized avatar

Alan Baines abaines-phx

View GitHub Profile
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@djangofan
djangofan / MultiThreadedJUnitRunner.java
Last active February 18, 2021 00:57
A multi-threaded JUnit runner example.
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
/**
* Runs all tests in parallel and waits for them to complete.
@TheGreatRambler
TheGreatRambler / szudzik.js
Last active February 10, 2024 20:23
A pairing function (szudzik) that supports negative numbers
// src https://codepen.io/sachmata/post/elegant-pairing
szudzik.getindex = function(x, y) {
var xx = x >= 0 ? x * 2 : x * -2 - 1;
var yy = y >= 0 ? y * 2 : y * -2 - 1;
return (xx >= yy) ? (xx * xx + xx + yy) : (yy * yy + xx);
};
szudzik.unpair = function(z) {
var sqrtz = Math.floor(Math.sqrt(z));