Skip to content

Instantly share code, notes, and snippets.

View peutetre's full-sized avatar
in a loop, building momo.coach and audio2text.email

Paul Panserrieu peutetre

in a loop, building momo.coach and audio2text.email
View GitHub Profile
@peutetre
peutetre / gist:818157
Created February 9, 2011 08:43
console.log wrapper....
// just working on FF
var log = (function() {
if(window.console && typeof window.console.log === 'function')
return console.log
return function() {}
})();
// idem
if (typeof console == "undefined" || typeof console.log == "undefined") {
@peutetre
peutetre / annotated.js
Created May 17, 2011 18:36 — forked from madrobby/annotated.js
Unit testing
var test = function(
a, // a object holding test functions
b, // a logging function, taking multiple arguments
c, // placeholder
d, // placeholder
e, // placeholder
f // placeholder
){
c = d = e = 0; // initialize asserts, failures and exception counts to 0
for ( // iterate
@peutetre
peutetre / gist:1424872
Created December 2, 2011 21:18
Stupid q.js test (serial join)
<!DOCTYPE html>
<html>
<head>
<script src="q.js"></script>
<script>
function add(millis, answer, msg) {
const defer = Q.defer();
setTimeout(function() {
@peutetre
peutetre / gist:3781590
Created September 25, 2012 12:50
Show Safari remote inspector from the command line
try
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
tell menu bar 1
tell menu bar item "Develop"
tell menu "Develop"
tell menu "iPhone Simulator" of menu item "iPhone Simulator"
delay 1
@peutetre
peutetre / example.js
Last active December 16, 2015 02:19
Zanimo.js examples used my talk @paris.js 28
// example 1
// create a cube
var cube = create([{
display:"none",
top:"50px",
left:"200px",
backgroundColor:"rgb(225, 70, 128)"
}])[0];
@peutetre
peutetre / index.js
Created July 9, 2013 09:09
made with requirebin.com
// tiny Zanimo.js example
var Zanimo = require('zanimo'),
Qimage = require('qimage');
function setup() {
return Qimage("http://requirebin.com/logo-black.png")
.then(function (img) {
img.style.position = 'absolute';
img.style.top = '100px';
@peutetre
peutetre / gist:6900094
Created October 9, 2013 11:55
lui stuff
if (config) {
for(var ƒ in config) {
if (typeof config[ƒ] === "function") {
this[ƒ] = lui.bind(config[ƒ], self);
}
}
}
@peutetre
peutetre / .zshrc
Created October 23, 2013 22:27 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@peutetre
peutetre / index.js
Created April 25, 2014 15:14
requirebin sketch
var Zanimo = require('zanimo');
var prefix = require('vendor-prefix');
var elt = document.createElement('div');
elt.style.height = '100px';
elt.style.width = '800px';
elt.style.position = 'absolute';
elt.style.top = '50px';
elt.style.left = '50px';
@peutetre
peutetre / index.js
Created June 8, 2014 09:31
requirebin sketch
var norm = require('zanimo/src/normalize-transform-value'),
Color = require('color');
var el = document.createElement('div');
el.style.height='300px';
el.style.width='500px';
document.body.appendChild(el);
// testing normalize-transform-value