Skip to content

Instantly share code, notes, and snippets.

View espadrine's full-sized avatar

Thaddée Tyl espadrine

View GitHub Profile
@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.
@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() {
@espadrine
espadrine / argument.txt
Created September 9, 2014 23:54
Classoid
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 / watcher-no-dotfile.patch
Created October 30, 2014 15:31
Remove dot files from ember-cli sane watcher's reach
--- 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));
-};

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 / tweet.sh
Created November 2, 2011 18:05
Twitter bash script
#!/bin/bash
# Configure your account.
USER=espadrine
# Ask for the password.
echo -n password\ ; read -s PASS
curl -u $USER:$PASS -d status="$1" http://twitter.com/statuses/update.xml
@espadrine
espadrine / data-markdown.user.js
Created November 8, 2011 21:18 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>, bits by Thaddee Tyl <http://espadrine.github.com/>
// @link http://git.io/data-markdown
// @include *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@espadrine
espadrine / data-markdown.user.js
Created November 9, 2011 06:40 — forked from passcod/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name *[data-markdown]
// @version 2.0
// @description Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/> and others
// @include *
// ==/UserScript==
// Contribs:
// Thaddee Tyl <http://espadrine.github.com/>
@espadrine
espadrine / configure.log
Created November 19, 2011 21:07
Configure output while trying to compile the Rust compiler
configure: looking for configure programs
configure: found mkdir
configure: found printf
configure: found cut
configure: found grep
configure: found xargs
configure: found cp
configure: found find
configure: found uname
configure: found date
@espadrine
espadrine / async-ed
Created January 19, 2012 13:51
Array Processing in Event Loops
var async = require('async');
function differedFactorial(n /* Number */, cb /* Function */) {
if (n < 0) cb(new Error('Complex infinity'));
setTimeout(function() {
var result = 1;
for (; n > 1; n--) {
result = result * n;
}
cb(null, result); // No errors, result is given.