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
package bam; | |
import static bam.ChiffreRomain.Chiffre.*; | |
import static java.lang.Math.abs; | |
import static java.util.Arrays.asList; | |
public class ChiffreRomain { | |
public final String chiffreRomain; | |
enum Chiffre { |
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
private int calculepalier(StringBuffer buffer, int chiffre, Chiffre chiffreCourant, Chiffre precedent) { | |
int nombrePalier = chiffre / chiffreCourant.chiffreArabe; | |
for (int i = 0; i < nombrePalier; i++) { | |
if (chiffre >= chiffreCourant.chiffreArabe) { | |
buffer.append(chiffreCourant.name()); | |
chiffre -= chiffreCourant.chiffreArabe; | |
} | |
} | |
if (chiffre == chiffreCourant.chiffreArabe - precedent.chiffreArabe) { | |
buffer.append(precedent.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
from multiprocessing.process import Process | |
import time | |
import redis | |
def pub(myredis): | |
for n in range(10): | |
myredis.publish('channel','blah %d' % n) | |
time.sleep(5) | |
def sub(myredis, 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
git archive --remote=<url_repo> <branche> [<chemin>] | tar xvf |
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
// pour memoire | |
App = Ember.Application.create(); | |
var marks = [ | |
{id: '1', title: 'barreverte', url: "http://barreverte.fr"}, | |
{id: '2', title: 'leanagilecamp', url: "http://leanagilecamp.fr"}, | |
{id: '3', title: 'ansamb', url: 'http://www.ansamb.com'} | |
]; | |
App.Router.map(function () { |
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
from zipfile import ZipFile | |
def append_file(memory_stream, file_name, file_content): | |
with ZipFile(memory_stream, 'a') as zf: | |
zf.writestr(file_name, file_content) |
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
$fn = 200; | |
tasse(160, 120); | |
rotate([90, 0, 0]) | |
translate([65, 80, 0]) | |
anse_ronde(); | |
module tasse(hauteur, diametre) { | |
difference() { |
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
sudo mount /dev/sda1 /mnt | |
sudo mount --bind /dev /mnt/dev | |
sudo mount --bind /dev/pts /mnt/dev/pts | |
sudo mount --bind /proc /mnt/proc | |
sudo mount --bind /sys /mnt/sys | |
sudo chroot /mnt |
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
# install with ubuntu 13.10 64 bits - warning with 32bits apt wont find the package | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" | |
sudo apt-get update | |
sudo apt-get install lxc-docker | |
# check install ok | |
sudo docker ps -a | |
# lets play with containers |
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
bindir=$(dirname $0) | |
root_dir=$bindir/root_dir | |
montePointsPourChroot() { | |
sudo echo -ne « mounting pseudo filesystems: » | |
for pseudo in dev proc sys | |
do | |
sudo mount –bind /$pseudo $root_dir/$pseudo | |
echo -ne » $pseudo » | |
done |