Skip to content

Instantly share code, notes, and snippets.

Rousseau Alexandre madeindjs

Block or report user

Report or block madeindjs

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 number_to_french.rb
# on inclue la librairie de test de Ruby pour faires quelques petits test unitaires
require 'test/unit'
# On va gérer toute la conversion dans une classe qui va avoir une méthode `translate` qui s'occupera de tout traduire.
# La classe va nous permettre de mieux organizer le code en plusieurs méthodes plus petites et donc plus lisibles
class Converter
# On va commencer par définir des constantes (aka des variables qui ne changerons jamais)
# En Ruby, les constantes sont des variables nomées en majuscule
# La syntaxe avec le `%w[]` permet simplement de définir des tableaux en mode un peu plus sexy.
madeindjs / number_to_english_2.rb
Created May 12, 2019
Juste quelques améliorations au niveau des nommages
View number_to_english_2.rb
# Il vaut mieux définir des constantes (aka des variables qui ne changerons jamais)
# en dehors de la méthode. Les constantes sont juste nomées en majuscule
# La syntaxe avec le `%w[]` permet simplement de définir des tableaux en mode un peu plus sexy
NUMBER_TRANSLATIONS = %w[one two three four five six seven eight nine].freeze
DOZEN_TRANSLATIONS = %w[ten twenty thirty forty fifty sixty seventy eighty ninety].freeze
TEENAGERS = %w[eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen].freeze
# Convert a number to a beautiful string
# @param [Integer] as a number
View api_consumer.html
<!DOCTYPE html>
<html lang="fr">
<meta charset="utf-8">
<title>TODO front-end</title>
<div id="app">
madeindjs / json.swift
Created Apr 12, 2019
Fetch & Parse JSOn from
View json.swift
import Foundation
let decoder = JSONDecoder()
let uri : String = ""
let feedUrl = URL(string: uri)!
struct Recipe : Codable {
var id : Int
var name : String
madeindjs / wifi_scanner.rb
Last active Mar 28, 2019
Scan a Wifi and log each new device connected on it
View wifi_scanner.rb
require 'hooray'
require 'logger'
LOG_FILE = './wifi.log'.freeze
class Scanner
attr_reader :logger
madeindjs / oop.rb
Last active Jan 8, 2019
A simple of OOP in ruby
View oop.rb
# A class who provide access to database
class Record
attr_accessor :title
# Create and return the record
def self.create(title)
record =
record.title = title
madeindjs / template_benchmark.rb
Created Nov 10, 2018
Benchmarking of existing templating libs
View template_benchmark.rb
require 'erb'
require 'haml'
require 'slim'
require 'benchmark'
class Context
attr_reader :title, :content
def initialize(title, content)
@title = title
today=$(date +%Y-%m-%d)
madeindjs /
Last active Nov 8, 2017 — forked from bartoszmajsak/
How to automatically prepend git commit with a branch name
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
madeindjs / redmine_colors_ticket.js
Last active Feb 22, 2018
Color tickets assigned to me
View redmine_colors_ticket.js
// ==UserScript==
// @name Color Redmine Flow
// @version 1
// @grant none
// ==/UserScript==
var nameToSearch = /Rousseau/;
var unavailableColor = "GhostWhite";
var activeColor = "Gold";
var testColor = "Khaki";
You can’t perform that action at this time.