Skip to content

Instantly share code, notes, and snippets.

View blixt's full-sized avatar
🗺️
Exploring

Blixt blixt

🗺️
Exploring
View GitHub Profile
diff --git a/assets/objects/avian/midjar1/midjar1.frames b/assets/objects/avian/midjar1/midjar1.frames
index dedf799..11b9c4d 100644
--- a/assets/objects/avian/midjar1/midjar1.frames
+++ b/assets/objects/avian/midjar1/midjar1.frames
@@ -1,7 +1,7 @@
{
"frameGrid" : {
- "size" : [11, 12],
+ "size" : [12, 11],

Keybase proof

I hereby claim:

  • I am blixt on github.
  • I am blixt (https://keybase.io/blixt) on keybase.
  • I have a public key whose fingerprint is C26D 7B7A 6A03 8103 2C94 4B7B E76D 7FC3 1C26 C0ED

To claim this, I am signing this object:

// Set up the feed node.
var feedNode = <feed onShowNewStories={store.dequeue.bind(store)} />;
React.renderComponent(feedNode, document.getElementById('react'));
// Keep track of the state of the feed service.
store.on('statechange', function() {
feedNode.setState({storeState: store.state});
});
import json
import re
with open('hashtag-shares.json') as f:
rows = f.readlines()
hashtags = dict()
for row in rows:
share = json.loads(row)
@blixt
blixt / index.js
Created July 24, 2014 21:01
requirebin sketch
var fnv = require('fnv-plus');
for (var i = 0; i < 100; i++)
console.log(fnv.hash(i.toString(), 32).value);
@blixt
blixt / prng.js
Last active January 14, 2024 07:01
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
/**
@blixt
blixt / procedural-avatar.js
Last active December 29, 2020 14:32
Procedural avatars using procedural.
var avatar = procedural('avatar')
.takes('username')
// Size, in blocks.
.takes('size', function validate(avatar, blocks) {
return typeof blocks == 'number' && blocks > 0;
})
// The pixel size of a single (square) block.
.takes('blockSize', function validate(avatar, px) {
return typeof px == 'number' && px > 0;
})
@blixt
blixt / TestingRNGs.md
Last active November 5, 2021 13:42
Testing random number generators with DieHarder

Testing RNGs with Dieharder

This guide is specifically for pseudo-random number generators (PRNGs) written in JavaScript, and tested in Mac OS X.

Prerequisites

Homebrew

@blixt
blixt / asm.js
Created August 2, 2014 15:50
Slow asm.js?
function murmurhash3(stdlib, foreign, heap) {
"use asm";
var int32 = new stdlib.Int32Array(heap);
function murmurhash3_32(idx, len, seed) {
idx = idx | 0;
len = len | 0;
seed = seed | 0;
var h = 0, k = 0, i = 0;
@blixt
blixt / Alea
Created August 2, 2014 18:05
Results of running Dieharder on procedural PRNGs
#=============================================================================#
# dieharder version 3.31.1 Copyright 2003 Robert G. Brown #
#=============================================================================#
rng_name | filename |rands/second|
file_input| alea.txt| 3.72e+06 |
#=============================================================================#
test_name |ntup| tsamples |psamples| p-value |Assessment
#=============================================================================#
# The file file_input was rewound 1 times
diehard_birthdays| 0| 100| 100|0.91201959| PASSED