Skip to content

Instantly share code, notes, and snippets.

Avatar

Batiste Bieler batiste

View GitHub Profile
View md5.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pour executer ce script
# 1. Avoir python installé (déjà présent sur Mac ou Linux)
# 2. Ouvrir un Terminal (logiciel Terminal sur mac)
# 3. Taper dans le terminal: python <ce script> <le répértoire> > <fichier de sortie>
# E.g. python md5.py /Users/toto/Documents > output.txt
import glob
import hashlib
import sys
@batiste
batiste / DogPage.blop
Created Jun 6, 2019
Blop language example
View DogPage.blop
import { DogGame } from './DogBreedGame.blop'
def DogPage(attributes) {
{ state } = attributes
<DogGame page=state.dogPage state=state loading=state.loading>
= 'Dog breed game'
</DogGame>
}
@batiste
batiste / splicer.py
Created Jun 22, 2012
Prototype for a multiprocessing test runner for Django
View splicer.py
#!/usr/bin/env python
import multiprocessing
import os
import sys
import unittest
from django.test.simple import DjangoTestSuiteRunner
def run_test_slice(test_labels, extra_tests, slice_index, number_process):
print "Run test slice %s" % (slice_index)
runner = DjangoTestSuiteRunnerSlice(slice_index=slice_index,
View Supervisord startup
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@batiste
batiste / Js sugar
Last active Aug 29, 2015
A proposition for some simple syntactic sugar that compiles to Javascript
View Js sugar
Goal:
1. Not reinventing JavaScript. Minimalistic sugar.
2. Aleviate the verbosness of the language especially with function definition, semicolon, and the var keyword
3. Avoid CoffeScript error http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/
Features? Implicit return?
Implementation? PEG.js http://pegjs.majda.cz/online
@batiste
batiste / expression.js
Last active Aug 29, 2015
Easy expression engine in JavaScript
View expression.js
function replaceOutOfStrings(str) {
var index = 0, length = str.length, ch;
var new_str = "", inString = null, start = 0;
while(index < length) {
ch = str.charAt(index);
if(ch === '\\') {
index = index + 2;
continue;
}
if(ch === '"' || ch === "'") {
@batiste
batiste / index.js
Created Jun 11, 2014
requirebin sketch
View index.js
var likely = require("likely.js");
var data = {list:[1, 2, 3]};
var template = likely.Template([
'for key, value in list',
' p',
' {{ value }}'
]);
var tree1 = template.tree(likely.Context(data));
@batiste
batiste / index.js
Created Jun 11, 2014
requirebin sketch
View index.js
var likely = require("likely.js");
var data = {list:[1, 2, 3]};
var template = likely.Template([
'for key, value in list',
' p',
' {{ value }}'
]);
var tree1 = template.tree(likely.Context(data));
You can’t perform that action at this time.