Skip to content

Instantly share code, notes, and snippets.

@jackrugile
jackrugile / calc.js
Last active January 8, 2019 15:38
Some common calculation helpers I use in a lot of my demos and games.
class Calc {
/*
------------------------------------------
| rand:float - returns random float
|
| min:number - minimum value
| max:number - maximum value
|
| Get a random float between two values
@Idloj
Idloj / try
Created July 24, 2017 06:50
Open files when you don't know their full name (or just want to save time)
#!/bin/bash -e
LOOP=false
BG=false
while true; do
case $1 in
-l|--loop) LOOP=true; shift ;;
-b|--background) BG=true; shift ;;
*) break
@kaleksandrov
kaleksandrov / global-protect.sh
Last active January 29, 2026 20:29
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
@ikenna
ikenna / print system and environment properties in sbt console
Last active February 29, 2024 15:00
SBT print system properties and env proprties
sbt> eval new scala.sys.SystemProperties().foreach(x => println(x))
sbt> eval scala.sys.env.foreach(x => println(x))
@blixt
blixt / prng.js
Last active January 3, 2026 05:52
A very simple, seedable JavaScript PRNG. NOTE: Please read comments on why this is not a good choice.
// NOTICE 2020-04-18
// Please see the comments below about why this is not a great PRNG.
// Read summary by @bryc here:
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md
// Have a look at js-arbit which uses Alea:
// https://github.com/blixt/js-arbit
/**
@kseo
kseo / recon.ml
Last active October 1, 2024 17:28
A Hindley-Milner type inference implementation in OCaml
#! /usr/bin/env ocamlscript
Ocaml.ocamlflags := ["-thread"];
Ocaml.packs := [ "core" ]
--
open Core.Std
type term =
| Ident of string
| Lambda of string * term
| Apply of term * term