This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="fr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>TODO front-end</title> | |
</head> | |
<body> | |
<div id="app"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let decoder = JSONDecoder() | |
let uri : String = "http://raspberry-cook.fr/recipes/buddha-bowl-au-thon-cuit.json" | |
let feedUrl = URL(string: uri)! | |
struct Recipe : Codable { | |
var id : Int | |
var name : String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hooray' | |
require 'logger' | |
LOG_FILE = './wifi.log'.freeze | |
INTERVAL_TIME = 30 | |
DEFAULT_NODE_NAME = 'UNKNOW'.freeze | |
class Scanner | |
attr_reader :logger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A class who provide access to database | |
class Record | |
attr_accessor :title | |
# Create and return the record | |
def self.create(title) | |
record = Record.new | |
record.title = title | |
record.save | |
record | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'erb' | |
require 'haml' | |
require 'slim' | |
require 'benchmark' | |
class Context | |
attr_reader :title, :content | |
def initialize(title, content) | |
@title = title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
green='\e[0;32m' | |
darkred='\e[1;31m' | |
lightblue='\e[1;34m' | |
defaut='\033[0m' | |
today=$(date +%Y-%m-%d) | |
foldername_save="pi3" | |
folder_save="${HOME}/backup/${foldername_save}" | |
sqldump_filename="_dump_${today}.sql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Color Redmine Flow | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var nameToSearch = /Rousseau/; | |
var unavailableColor = "GhostWhite"; | |
var activeColor = "Gold"; | |
var testColor = "Khaki"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# .git/hooks/pre-commit | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
DEFAULT='\033[0m' | |
# loop on all commited PHP files | |
echo -e "\n${GREEN}Check PHP files${DEFAULT}\n" |