Skip to content

Instantly share code, notes, and snippets.

View borisschapira's full-sized avatar

Boris Schapira borisschapira

View GitHub Profile
@borisschapira
borisschapira / multitail.conf
Created February 12, 2016 08:50 — forked from Stubbs/multitail.conf
Basic Multitail config for colourising Symfony2 log files.
colorscheme:symfony
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:blue: .*\.(INFO|NOTICE).*
cs_re:red: .*\.(ERROR|CRITICAL).*
cs_re:blue: \{[^}]+\}
Verifying that +borisschapira is my blockchain ID. https://onename.com/borisschapira
@borisschapira
borisschapira / GIF-Screencast-OSX.md
Created January 7, 2016 13:13 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@borisschapira
borisschapira / recursive_git_status.php
Last active August 29, 2015 14:25
Recursive `git status` for multiple projects folder
#!/usr/bin/php
<?php
$repos = array();
exec("find -type d -name .git -not -path '*/node_modules/*' -not -path '*/vendor/*' | sed -e 's/\.git//'", $repos);
foreach ($repos as $repo) {
$status = shell_exec("cd $repo && git status");
if (false == strpos($status, 'nothing to commit (working directory clean)')) {
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n";
}
}
@borisschapira
borisschapira / csvSplit.bat
Created June 10, 2014 10:03
CSV Batch splitter
@echo off
setLocal EnableDelayedExpansion
GOTO checkvars
:checkvars
IF "%1"=="" GOTO syntaxerror
IF NOT "%1"=="-f" GOTO syntaxerror
IF %2=="" GOTO syntaxerror
IF NOT EXIST %2 GOTO nofile
IF "%3"=="" GOTO syntaxerror
@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
@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 / 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 / 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 / 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