Skip to content

Instantly share code, notes, and snippets.

Thaddée Tyl espadrine

Block or report user

Report or block espadrine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@espadrine
espadrine / OutputBigCrush
Last active Oct 21, 2019
Harmonoise PRNG
View OutputBigCrush
./harmonoise-big-crush
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Starting BigCrush
Version: TestU01 1.2.3
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
***********************************************************
Test smarsa_SerialOver calling smultin_MultinomialOver
View rr.sh
$ rr record cargo test
rr: Saving execution to trace directory `/home/tyl/.local/share/rr/cargo-4'.
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running target/debug/deps/bench_insert-8cb017bd9e593f1f
running 5 tests
test tests::bench_insert_list ... ok
test tests::bench_insert_vec ... ok
test tests::test_insert_list ... ok
test tests::test_insert_tree_array ... FAILED
@espadrine
espadrine / new.js
Last active Mar 20, 2016
Potential new ScoutCamp API
View new.js
// Server demo. `node app [PORT [https]]`
// © 2011-2016 Thaddée Tyl, Jan Keromnes. LGPL.
let port = +process.argv[2] || +process.env.PORT || 1234
let camp = require('./lib/camp.js')
let sc = camp.start({port: port, secure: process.argv[3] === 'https'})
console.log('http://[::1]:' + port)
// Templating demo: /template.html?title=Hello&info=[Redacted].
sc.path('template.html')
@espadrine
espadrine / perl6.js
Created Jun 19, 2015
Perl6 CodeMirror syntax highlighting mode
View perl6.js
// Parts from Ace; see <https://raw.githubusercontent.com/ajaxorg/ace/master/LICENSE>
CodeMirror.defineMode("perl6", function(cmCfg, modeCfg) {
// Fake define() function.
var moduleHolder = Object.create(null);
// Given a module path as a string, create the canonical version
// (no leading ./, no ending .js).
var canonicalPath = function(path) {
return path.replace(/\.\//, '').replace(/\.js$/, '');
View keybase.md

Keybase proof

I hereby claim:

  • I am espadrine on github.
  • I am espadrine (https://keybase.io/espadrine) on keybase.
  • I have a public key whose fingerprint is 4AE5 032E 679C D54C 0AA1 6520 BF5F 9DA7 282E F842

To claim this, I am signing this object:

@espadrine
espadrine / watcher-no-dotfile.patch
Created Oct 30, 2014
Remove dot files from ember-cli sane watcher's reach
View watcher-no-dotfile.patch
--- node_modules/ember-cli/node_modules/broccoli-sane-watcher/index.js
+++ node_modules/ember-cli/node_modules/broccoli-sane-watcher/index.js
@@ -76,20 +76,19 @@
this.watched[dir] = watcher;
};
-Watcher.prototype.onFileChanged = function (filePath, root) {
- if (this.options.verbose) console.log('file changed', filePath);
- this.scheduleBuild(path.join(root, filePath));
-};
@espadrine
espadrine / sync-stdin.js
Created Sep 12, 2014
How to read stdin synchronously in nodejs.
View sync-stdin.js
var fs = require('fs');
// Returns a buffer of the exact size of the input.
// When endByte is read, stop reading from stdin.
function getStdin(endByte) {
var BUFSIZE = 256;
var buf = new Buffer(BUFSIZE);
var totalBuf = new Buffer(BUFSIZE);
var totalBytesRead = 0;
var bytesRead = 0;
View argument.txt
Arguably, in `page.inadequate.css`, this `.left` class should be `.block.left`, and `.right-on-hover` ought to be `.block.right-on-hover`, or something like that.
Still, creating name conflicts is a trap made hard to avoid.
Using namespaces eases the process. Classoids provide hierarchical classes. In this example, our rules related to `left` specifically on a `button` only apply on a `button` classoid; the `left` class does not apply to it. This avoids the name clashing.
(Unfortunately, CSS namespaces is already a thing, extended from XML namespaces, not what we want. I picked the term "classoid", because it is like a class.)
The example is contrived, but the problem is present. See also the last slides here <http://www.slideshare.net/stubbornella/object-oriented-css>.
@espadrine
espadrine / deriv.rs
Last active Aug 29, 2015
Fix from [benh].
View deriv.rs
use std::f64::consts::PI;
fn deriv(f: |f64| -> f64, g: |(|f64| -> f64)|) {
g(|x: f64| -> f64 {
let epsilon = 0.0000000001;
(f(x + epsilon) - f(x)) / epsilon
});
}
fn main() {
View asciidoc.js
// Parts from Ace; see <https://raw.githubusercontent.com/ajaxorg/ace/master/LICENSE>
CodeMirror.defineMode("asciidoc", function(cmCfg, modeCfg) {
// Ace highlight rules function imported below.
var HighlightRules = function() {
var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b";
this.$rules = {
"start": [
{token: "empty", regex: /$/},
You can’t perform that action at this time.