Skip to content

Instantly share code, notes, and snippets.

View espadrine's full-sized avatar

Thaddée Tyl espadrine

View GitHub Profile
@espadrine
espadrine / deriv.rs
Last active August 29, 2015 14:02
Fix from [benh].
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() {
// 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: /$/},
@espadrine
espadrine / badge-1px.svg
Created March 13, 2014 15:26
A badge with a 1px change.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[![stability 0 - deprecated](http://b.adge.me/:stability-0_--_deprecated-red.svg)
](http://nodejs.org/api/documentation.html#documentation_stability_index)

stability 0 - deprecated

@espadrine
espadrine / color-cheat-golf.js
Last active January 3, 2016 19:29 — forked from jankeromnes/color-cheat-golf.js
Cheat on <http://www.colormunki.com/game/huetest_kiosk>. How to get the best score, how to get the worst score.
for(i=0;++i<5;)for(j=2;++j<22;)eval('a=patch_'+i+'_'+j).parentNode.appendChild(a)
@espadrine
espadrine / color-cheat-golf.js
Last active January 3, 2016 19:09 — forked from jankeromnes/color-cheat-golf.js
Cheat on <http://www.colormunki.com/game/huetest_kiosk>. How to get the best score, how to get the worst score.
for(j=8;j++<88;)eval('a=patch_'+(j%4+1)+'_'+(j>>2)).parentNode.appendChild(a)
for(i=1;i<5;i++)for(j=2;j<22;)eval('a=patch_'+i+'_'+j++).parentNode.appendChild(a)
@espadrine
espadrine / OpenSans-Regular.json
Created January 18, 2014 20:33
Open Sans glyphs as SVG paths. Using glyph unicode character / &#x…; / glyph name as key (by order of fallback).
This file has been truncated, but you can view the full file.
{
"font-family": "Open Sans",
"font-weight": "400",
"font-stretch": "normal",
"units-per-em": "2048",
"panose-1": "2 11 6 6 3 5 4 2 2 4",
"ascent": "1638",
"descent": "-410",
"x-height": "1096",
"cap-height": "1462",
@espadrine
espadrine / color-cheat-golf.js
Last active January 3, 2016 16:39
Cheat on <http://www.colormunki.com/game/huetest_kiosk>. How to get the best score, how to get the worst score.
for(i=1;i<5;i++)for(j=2;j<22;)eval('a=patch_'+i+'_'+j++).parentNode.appendChild(a)
@espadrine
espadrine / format-font.svg
Created January 16, 2014 10:26
Badge comparison
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.