Skip to content

Instantly share code, notes, and snippets.

View ArnaudRinquin's full-sized avatar
🦆
rubber ducking

Arnaud Rinquin ArnaudRinquin

🦆
rubber ducking
View GitHub Profile
@ArnaudRinquin
ArnaudRinquin / Timer.js
Created November 30, 2012 13:11
setInterval vs. custom timer drift test
/*
This code runs the same test as above but replacing setInterval by a custom interval maker : the Timer class.
The results must be read the same way : First value should be as close to 0 or 1000 as possible (any other value shows how "off the spot" the timing of the trigger was.) Second value is number of times the code has been triggered, and third value is how many times the could should have been triggered.
*/
Timer = (function() {
@ArnaudRinquin
ArnaudRinquin / robot.js
Created December 4, 2012 08:58
Flibustache
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.state = "spawned";
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
switch(this.state) {
@ArnaudRinquin
ArnaudRinquin / .zshrc
Created June 12, 2013 12:48
oh-my-zsh configuraiton file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
DEFAULT_USER="arnaud"
{
"auto_indent": true,
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"drag_text": false,
"fallback_encoding": "UTF-8",
"file_exclude_patterns":
[
@ArnaudRinquin
ArnaudRinquin / keybase.md
Created March 26, 2014 15:58
keybase.md

Keybase proof

I hereby claim:

  • I am ArnaudRinquin on github.
  • I am ArnaudRinquin (https://keybase.io/ArnaudRinquin) on keybase.
  • I have a public key whose fingerprint is ED6E 1710 7187 A0FB 03F1 77B3 DA50 87A2 52DD 3CA6

To claim this, I am signing this object:

@ArnaudRinquin
ArnaudRinquin / README.md
Last active February 5, 2021 15:56
Clean Express controllers using currying and promises

Purpose

Demonstrate how to write clean express controllers using function currying, functionnal programming and promises.

  • Promises helps avoiding callback hell
  • Currying helps code reuse
  • Functional programing makes data flow clearer

Aknowledgment

class: center, middle
# Title
---
# Agenda
1. Introduction
2. Deep-dive

Keybase proof

I hereby claim:

  • I am ArnaudRinquin on github.
  • I am arnaudrinquin (https://keybase.io/arnaudrinquin) on keybase.
  • I have a public key whose fingerprint is 7DF4 98A4 180D 8B9D A7DD A450 EE69 AC6A 9AA0 2547

To claim this, I am signing this object:

@ArnaudRinquin
ArnaudRinquin / git-add-patch.md
Last active April 22, 2016 00:01
Git + Oh-My-Zsh = ❤

gap: git add -p for patch mode.

diff --git a
/gulpfile.js b/gulpfile.js
index 61d4a62..0e626f7 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -7,7 +7,7 @@ require('coffee-script').register();
 // * basics libs