Skip to content

Instantly share code, notes, and snippets.

View borisschapira's full-sized avatar

Boris Schapira borisschapira

View GitHub Profile
@borisschapira
borisschapira / gist:3825736
Created October 3, 2012 08:06
TypeScript Simple Inheritance
class Animal {
constructor(public name) { }
move(meters) {
alert(this.name + " moved " + meters + "m.");
}
}
class Snake extends Animal {
constructor(name) { super(name); }
move() {
@borisschapira
borisschapira / .gitconfig
Last active April 26, 2016 09:54
Config GIT
[user]
name = user
email = mail
[color]
ui = true
diff = auto
interactive = auto
[alias]
st = status
@borisschapira
borisschapira / msysgit.bashrc
Last active December 21, 2015 03:39
Config Bash
export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWUPSTREAM=verbose GIT_PS1_DESCRIBE_STYLE=branch
alias sfc='php app/console'
alias sf2-shell='sfc --shell'
alias composer='php /c/wamp/www/Composer/composer.phar'
@borisschapira
borisschapira / gist:7004888
Last active December 25, 2015 16:19
Trac Workflow
leave = * -> *
leave.name = Ne rien faire
leave.default = 9
leave.operations = leave_status
reject = new -> rejected
reject.name = Rejeter (à re-qualifier)
reject.default = 8
reject.permissions = TICKET_MODIFY
propose = rejected -> new
propose.name = Soumettre à nouveau
@borisschapira
borisschapira / colissimo.bkmrk.js
Last active December 26, 2015 05:39
Bookmarklet de suivi Colissimo, remplacer 11111111111 par votre identifiant de colis à suivre.Valide au 22/10/2013. Aucune garantie.
(function(){
var post_to_url = function(path, params, method) {
var openWindow = window.open(path);
method = method || "post";
var form = openWindow.document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in params) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
@borisschapira
borisschapira / premiers.js
Created December 19, 2013 15:13
Calcul des nombres premiers inférieurs à 200
if (!premiers)
var premiers = [];
function PremiersInferieursA(maxNumber, fromNumber) {
if (!fromNumber)
fromNumber = 0;
function estPremierSachantInferieursTestes(n) {
// Si on l'a déjà testé, on sait
@borisschapira
borisschapira / konami.bkmrk.js
Last active January 4, 2016 00:39
Konami code IIFE, reproduces a Konami Code on both Firefox and Chrome
(function () {
// The Unicode keys
var characterKeys = {
u: 38,
d: 40,
l: 37,
r: 39,
a: 65,
b: 66
};
@borisschapira
borisschapira / leconjugueur.bkmrk.js
Last active August 29, 2015 13:56
LeConjugueur.com Bookmarklet
(function () {
var verb = prompt("Verbe à chercher sur LeConjugueur.com :", "");
var openWindow = window.open("http://leconjugueur.lefigaro.fr/php5/index.php?verbe=" + verb);
})()
@borisschapira
borisschapira / uplr.random.bkmrk.js
Created March 12, 2014 17:44
Random Up, Down, Left, Right
(function () {
function shuffle(array) {
var currentIndex = array.length,
temporaryValue,
randomIndex
;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
@borisschapira
borisschapira / hideDot.bat
Created April 10, 2014 07:58
Applying the dot-file convention for hidden files in Windows, for the current folder (no parameter passed) or a specified list of folders (one after another).
@ECHO OFF
IF "%1"=="" GOTO HAVE_0
:Loop
IF "%1"=="" GOTO Continue
set "template=%1\.*"
ECHO."Hiding 'dot directories' in folder %1"
ATTRIB +H /s /d %template%
SHIFT
GOTO Loop
GOTO Continue