Skip to content

Instantly share code, notes, and snippets.

View Grahack's full-sized avatar

Prof Gra Grahack

View GitHub Profile
@Grahack
Grahack / bf.malg
Last active August 29, 2015 14:08
Proto d’interpréteur BF en MicroAlg http://microalg.info
(!!! "Interpréteur pour http://fr.wikipedia.org/wiki/Brainfuck")
(Definir (Recherche_dans liste element)
"Retourne la position du dernier élément de `liste` valant `element`.
Retourne 0 si aucun élément n’est trouvé."
"ProfGra"
(Initialiser position_element 0)
(Initialiser position 1)
(Faire
@Grahack
Grahack / obiwan tests
Created March 3, 2014 20:15
Testing obiwan, I don't understand why some exceptions are not raised.
"""Testing the obiwan module.
https://github.com/williame/obiwan
"""
from obiwan import *
install_obiwan_runtime_check()
def id1(x: int) -> int:
@Grahack
Grahack / casper_brython.js
Created February 14, 2014 08:43
Why doesn't CasperJS see the changes made by Brython?
var utils = require('utils');
var casper = require('casper').create();
casper.start('http://profgra.org/lycee/squelettes/html_css_js1.html', function() {
// was 'avant', JS put 'apres' instead
utils.dump(this.getElementsInfo('#ici')[0].html);
this.captureSelector('apres.png', 'body');
});
casper.thenOpen('http://brython.info/', function() {
// Casper file which dumps a page (and recursively continues).
var utils = require('utils');
// https://github.com/ariya/phantomjs/wiki/API-Reference-FileSystem
var fs = require('fs');
var casper = require('casper').create({
verbose: true,
logLevel: 'error',
pageSettings: {
loadImages: false,