Skip to content

Instantly share code, notes, and snippets.

View Perlkonig's full-sized avatar

Aaron Dalton Perlkonig

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();
@kaizau
kaizau / jquery.pathchange.js
Created May 29, 2011 21:59
Bugfix for [bcherry's](https://github.com/bcherry) pathchange proof of concept (IE needs quotes on attribute selectors - lines 66, 74)
// Plugin that provides a "pathchange" event on the window object, notifying an application when the URL changes
// This is accomplished by watching the hash, using the hashchange event from HTML5 or a polling interval in older browsers.
// In addition, in some modern browsers, HTML5 History Management is used to support changing the URL's path without reloading the page.
// This plugin also provides a method to navigate to a URL safely, that will use HTML5 History Management to avoid a page load.
// Everything degrades gracefully, and supports RESTful client development.
// Browser Support:
// Chrome - Any recent version of Chrome supports everything.
// Safari - Any recent version of Safari supports everything.
// Firefox - Newer versions of Firefox support the hashchange event
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dcalacci
dcalacci / export_google_music.js
Last active August 2, 2022 15:15 — forked from jmiserez/export_google_music.js
Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <jeremie@miserez.org>, 2015
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active June 23, 2024 21:12
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

-- For the animation, run with the love2d game engine
-- For the SVG output, run with the standard Lua interpreter
local narrow = false -- Change this to true to fold around the narrow angle instead of the wide one
local size = 14 -- This is the number of hexes on the side of the flat rhombus
local base_hex = {}
local s32 = math.sqrt(3)/2
local rad = 1/math.sqrt(3)