Skip to content

Instantly share code, notes, and snippets.

View Goutte's full-sized avatar

Antoine Goutenoir Goutte

View GitHub Profile
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@cheeaun
cheeaun / ExpatLiving.js
Created March 23, 2010 14:31
Some (jsbeautified) code stolen from http://m.expatliving.sg/ written by Jacky Nguyen
(function (a) {
window.ExpatLiving = {};
window.ExpatLiving.SearchLayer = new Class({
Implements: [Options, Events],
Binds: ["onFormSend", "onFormComplete", "onFormFailure"],
options: {},
initialize: function (c, b) {
this.element = a(c);
this.setOptions(b || {});
this.element.style.webkitTransitionProperty = "0";
@Goutte
Goutte / DumpyTwigFilter.php
Created February 5, 2012 18:25
Designer-friendly dump as YAML Twig Extension Filter
<?php
/**
* Extends Twig with
* {{ "my string, whatever" | pre }} --> wraps with <pre>
* {{ myBigVar | yaml_dump | pre }} as {{ myBigVar | ydump }} or {{ myBigVar | dumpy }}
* {{ myBigVar | var_dump | pre }} as {{ myBigVar | dump }}
*
* You may control the depth of recursion with a parameter, say foo = array('a'=>array('b'=>array('c','d')))
*
@myshkin-uk
myshkin-uk / show-cron-jobs.sh
Last active July 10, 2023 22:00
A bash script to list all cron tasks on a computer.
#!/bin/bash
# This script is designed to work only with recent bash implementations, not busybox/ash/dash etc...
# BEWARE - THIS IS SYMLINKED TO FROM THE NETRIX REPO ON DGC'S DESKTOP
# IF YOU EDIT IT THERE IT ALSO CHANGES THE MASTER ONE
# @FIXME DGC 6-May-2022
# This script has a large issue, which I have failed to notice ( or to fix ) earlier.
# It does a very bad job of labelling hourly/daily etc jobs with an 'execution time.
#