Skip to content

Instantly share code, notes, and snippets.

🦁
Writing the open-source software that you may be using everyday

Maël Nison arcanis

🦁
Writing the open-source software that you may be using everyday
Block or report user

Report or block arcanis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:83dc04ccf211a27291d0
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");
View virt.js
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 Aug 29, 2015
Linting Moumoute
View pre-commit.sh
#!/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
View gist:1255791
/**
* @class foo
*/
var foo = function () {
/**
* Stop, hammertime.
* @member foo
* @returns 42
View BAD.js
/**
* @class
*/
var foo = function () {
/**
* Stop, hammertime.
*
* @memberOf foo#
View gist:1255883
/**
* @mixin foo
*/
var foo = {
/**
* Does something.
*/
@arcanis
arcanis / gist:2724085
Created May 18, 2012
Classes en javascript
View gist:2724085
// 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"
View set-python-version.sh
#!/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)
View gist:3285710
<?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 ] );
You can’t perform that action at this time.