Skip to content

Instantly share code, notes, and snippets.

@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();
@Cybolic
Cybolic / iterateinpairs.jade
Created January 10, 2013 16:05
Jade template: Iterate over sequence in pairs.
n = 1
for item, i in list
- if (i%2 == 0) // even
- if (i != 0) // not first
!= "</div>"
!= "<div class=\"pairNr" + n + "\">"
- n++
.item
| Here's item number #{i+1}.
| It's a beautiful item, containing #{item}.
@sebastianhoitz
sebastianhoitz / StreamingResponse.coffee
Last active December 26, 2022 07:06
node.JS streaming zip file
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###
@jaywink
jaywink / firefox-developer-edition.desktop
Last active April 1, 2019 11:08
Firefox Developer Edition (or any edition), separate Unity launcher icon (Ubuntu 14.04)
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Firefox Developer Edition
Icon=/home/user/Apps/firefox/browser/icons/mozicon128.png
Path=/home/user/Apps/firefox
Exec=/home/user/Apps/firefox/firefox --class="firefox-developer" -P dev-edition-default %u
StartupNotify=true
StartupWMClass=firefox-developer
@ruario
ruario / h264-vivaldi-linux.md
Last active March 18, 2023 11:17
How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library
@flibitijibibo
flibitijibibo / flibitPackaging.md
Created June 17, 2016 16:00
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

@efrecon
efrecon / run.tpl
Last active July 16, 2024 10:49
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}