Skip to content

Instantly share code, notes, and snippets.

View niklasf's full-sized avatar

Niklas Fiekas niklasf

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();
@jeffery
jeffery / GitRepoUpdateTimestamp.sh
Created July 30, 2011 13:04
Update Timestamp of files in Checked-out Git Repository
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
@polyvertex
polyvertex / memstreambuf.h
Created April 12, 2019 20:37
A memory stream buffer class compliant with std::basic_streambuf
#pragma once
namespace xx {
// A memory stream buffer class compliant with `std::basic_streambuf`.
//
// Usage example:
//
// std::vector<char> data;
// // ... fill-in *data* here ...
@ianfab
ianfab / bench-parallel.sh
Created March 14, 2017 18:29
bench script
#!/bin/bash
if [[ $# -ne 3 ]]; then
echo "usage:" $0 "base test n_runs"
echo "example:" $0 "./stockfish_base ./stockfish_test 10"
exit 1
fi
base=$1
test=$2
n_runs=$3
@AstonJ
AstonJ / gist:2896818
Created June 8, 2012 16:47
Install/Upgrade Ruby on CentOS 6.2
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
@nilslindemann
nilslindemann / Unofficial Lichess Puzzle Storm Top 200 List.md
Last active June 23, 2021 23:10
Unofficial Lichess Puzzle Storm Top 200 List

Currently Discontinued

In June 22nd, 2021, a programming bug in Lichess' Puzzle Storm and Puzzle Racer games caused some players to achieve excessively high scores that are otherwise beyond their abilities. See e.g. this recording of the bug by Joseph Leung.

The resulting top list is therefore based on corrupted data; compare it with the last correct list and the lists from previous days (see the links "Yesterdays list").

The Lichess developers could have decided to delete all Puzzle scores from June 22nd and to recalculate the data sets based on them. But presumably for performance reasons, they only recalculate these data sets when