This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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(); |