Skip to content

Instantly share code, notes, and snippets.

View arcanis's full-sized avatar
:octocat:

Maël Nison arcanis

:octocat:
View GitHub Profile
barDemo.selectAll("rect").
data(data).
enter().
append("svg:rect").
attr("x", function(datum, index) { return x(index); }).
attr("y", function(datum) { return height - y(datum.books); }).
attr("height", function(datum) { return y(datum.books); }).
attr("width", barWidth).
attr("fill", "#2d578b");
var startEmulator = function (rom) {
var engine = Virtjs.create(Virtjs.engine.GameBoy, {
devices : {
screen : new Virtjs.screen.WebGL(),
input : new Virtjs.input.Keyboard({ map : map }),
timer : new Virtjs.timer.RAFrame(),
data : new Virtjs.data.LocalStorage()
},
@arcanis
arcanis / pre-commit.sh
Last active August 29, 2015 14:06
Linting Moumoute
#!/usr/bin/env bash
result=0
cd "$(git rev-parse --show-toplevel)"
# Stash the current changes, so that we preserve them
git stash -q --keep-index
# Get the list of changed files from the index
This file has been truncated, but you can view the full file.
[[[0.03100680559873581,0.03100680559873581,0.02847377024590969,0.028717918321490288,0.028717918321490288,0.03024384379386902,0.026612140238285065,0.03265480697154999,0.03265480697154999,0.020966216921806335,0.021820735186338425,0.006317331455647945,0.006317331455647945,-0.056581318378448486,-0.06955168396234512,-0.061342205852270126,-0.061342205852270126,-0.06695760786533356,-0.0632648691534996,-0.06482131779193878,-0.06482131779193878,-0.06433302164077759,-0.0640278309583664,-0.0636310949921608,-0.0636310949921608,-0.07016205042600632,-0.07663197815418243,-0.07492294162511826,-0.07492294162511826,-0.07525864243507385,-0.07513657212257385,-0.07480086386203766,-0.07480086386203766,-0.07473982870578766,-0.07477034628391266,-0.07412946224212646,-0.07412946224212646,-0.07473982870578766,-0.07379375398159027,-0.07379375398159027,-0.07422101497650146,-0.08294931054115295,-0.08606220036745071,-0.08606220036745071,-0.08520767837762833,-0.08474989980459213,-0.08560442179441452,-0.08560442179441452,-0.08319345861673355
/**
* @class foo
*/
var foo = function () {
/**
* Stop, hammertime.
* @member foo
* @returns 42
/**
* @class
*/
var foo = function () {
/**
* Stop, hammertime.
*
* @memberOf foo#
/**
* @mixin foo
*/
var foo = {
/**
* Does something.
*/
@arcanis
arcanis / gist:2724085
Created May 18, 2012 08:59
Classes en javascript
// Chaque fonction est un constructeur
var Foo = function ( ) { this.bar = 'hello world'; };
var instance = new Foo( );
console.log( instance.bar ); // "hello world"
// Chaque fonction possède un prototype
var Foo = function ( ) { };
Foo.prototype.bar = 'hello world';
var instance = new Foo( );
console.log( instance.bar ); // "hello world"
#!/usr/bin/env sh
# Usage :
# $> sudo set-python-version 2; python -V
# Python 2.7.2
# $> sudo set-python-version 3; python -V
# Python 3.2.2
python=$(which python)
pythonX=$(which python$1)
<?php
class StringRandomizer {
public function process( $text ) {
return preg_replace_callback('/\{(((?>[^\{\}]+)|(?R))*)\}/x', array( $this, 'replace' ), $text );
}
public function replace( $text ) {
$text = $this->process( $text[ 1 ] );