Skip to content

Instantly share code, notes, and snippets.

View espadrine's full-sized avatar

Thaddée Tyl espadrine

View GitHub Profile
@espadrine
espadrine / robert.sh
Created March 18, 2012 20:06
Get the definition of a french word from the command-line shell.
#!/bin/bash
# INSTALL: Put this in a shell script (eg, `~/bin/robert`).
# USE: `$ robert anticonstitutionnellement`.
wordId=$(curl "http://petitrobert.bvdep.com/list.asp?word=$1" \
-b "PR1Login=OK" 2>/dev/null \
| sed -En "/onload/{s/.*'([A-Z0-9]+)'.*/\1/
p
}")
@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.
@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 / 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 / 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 / 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