Skip to content

Instantly share code, notes, and snippets.

@clemsos
clemsos / .block
Created May 24, 2017 15:30
fresh block
license: mit
@clemsos
clemsos / .block
Last active May 24, 2017 15:50
test
license: mit
@clemsos
clemsos / index.html
Last active June 20, 2019 07:47
Basic genetic algorithm in JS
<!--
* Basic Genetic algorithm
* JS/ES6
*
* by @clemsos, with the help of Nature of Code
-->
<button onclick="start()">START</button>
<button onclick="stop()">STOP</button>
<button onclick="init()">INIT</button>
@clemsos
clemsos / d3colorpicker.js
Last active April 5, 2016 09:14
D3 simple color selector
//data (pass your color
var c20 = d3.scale.category20c();
var colors = d3.range(20).map(function(i){ return c20(i) });
var selectedColor = "black";
var h = 100,
w = 400,
colorOpened = false,
paddingX = 10
radius = 10;
@clemsos
clemsos / _.md
Last active April 5, 2016 08:33
D3 simple color selector
@clemsos
clemsos / gitbook_to_pdf.sh
Last active June 29, 2024 15:11
Build Gitbook PDF using Pandoc
# #!/bin/bash
GITBOOK_REP=$1
SUMMARY_FILE="SUMMARY.md"
echo $OUTPUT_FILE
if [ -d "$GITBOOK_REP" ]; then
echo "Entering directory '$GITBOOK_REP'..."
cd $GITBOOK_REP
@clemsos
clemsos / index.html
Created September 25, 2015 12:01 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/bedalu/1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
div {
width : 17px;
height: 19px;
color : white;
@clemsos
clemsos / multiple_pages_pdf_to_svg_inkscape.sh
Created September 4, 2014 14:49
PDF Multiple pages to clean SVG using Inkscape
#!/bin/bash
PDF_IN="LS58_Presentation_FR_EN.pdf"
BASENAME_OUT="junkware"
PAGE_START=2
PAGE_END=2
for ((i=$PAGE_START; i<=$PAGE_END; i++));
do
@clemsos
clemsos / run_tests.sh
Last active August 29, 2015 14:04
Bash script to run test with colored output using Python nosetest (all files or a single file)
#!/bin/bash
# USAGE :
#
# chmod +x run_tests.sh
# ./run_tests.sh # run all tests
# ./run_tests.sh xxx.py # run a single test
#
test_dir=`pwd`/tests
@clemsos
clemsos / odt_to_tex.sh
Created July 29, 2014 10:12
Couvert Word (.odt) files to Latex
#!/bin/bash
w2l -config ./w2l-config.xml chapitre-xxx.odt chapters/chapitre-xxx.tex