Skip to content

Instantly share code, notes, and snippets.

View ebrehault's full-sized avatar

Eric BREHAULT ebrehault

View GitHub Profile
### Keybase proof
I hereby claim:
* I am ebrehault on github.
* I am ebrehault (https://keybase.io/ebrehault) on keybase.
* I have a public key ASARc1t89FHAOqFB18dHFngo2xGnCgecUfU-7XcgQd7aRAo
To claim this, I am signing this object:
{
"fieldsets": [
{
"fields": [
"title",
"description"
],
"id": "default",
"title": "Default"
},
@ebrehault
ebrehault / precommit
Created December 4, 2017 16:01
.git/hooks/precommit
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
badimport='../core/lib'
# CHECK
if test $(git diff --cached | grep $badimport | wc -l) != 0
then
import { Component, OnInit, ElementRef } from '@angular/core';
import { D3Service, D3, Selection } from 'd3-ng2-service';
@Component({
selector: 'app-content-tree',
template: `<svg></svg>`,
styleUrls: ['./content-tree.component.css'],
})
export class ContentTreeComponent implements OnInit {
private d3: D3;
@ebrehault
ebrehault / adapter.ts
Last active May 31, 2016 15:11 — forked from bloodbare/adapter.ts
TypeScript version of adaptation (ZTK)
let registry:any = {}
function implementing(typeInterface: any) {
return (target: any) => {
if (target.providesInterfaces === undefined) {
target.providesInterfaces = [typeInterface];
} else {
target.providesInterfaces.push(typeInterface);
}
return target;
"use strict";
define(["module", "app"], function (module, app) {
app.lazy.service("localFS", [
"$q",
function ($q) {
var fstype = LocalFileSystem.PERSISTENT;
var path_prefix = "educlever/";
window.requestFileSystem(fstype, 0, function gotFS(fileSystem) {
var dataDir = fileSystem.root.getDirectory(path_prefix, {create: true});
@ebrehault
ebrehault / label-demo.xml
Created March 25, 2014 12:28
A Plomino form containing a field with its associated label
<plominodatabase id="label-demo">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@ebrehault
ebrehault / scenario1.js
Created February 4, 2014 15:19
a sample CasperJS test generated using Resurrectio
//==============================================================================
// Casper generated Tue Feb 04 2014 16:17:45 GMT+0100 (CET)
//==============================================================================
var x = require('casper').selectXPath;
casper.options.viewportSize = {width: 1855, height: 993};
casper.test.begin('Resurrectio test', function(test) {
casper.start('http://en.wikipedia.org/wiki/Main_Page');
casper.waitForSelector(x("//*[contains(text(), \'Welcome\')]"),
function success() {
from landez import TilesManager
from landez.proj import GoogleProjection
from shapely import geometry
from PIL import Image
import json
import os
min_color = 20
max_color = 235
grey_limit = 7
@ebrehault
ebrehault / gist:6925103
Created October 10, 2013 20:29
casperjs error traceback
TEST
-----
// googletesting.js
casper.test.begin('Google search retrieves 10 or more results', 5, function suite(test) {
casper.start("http://www.google.fr/", function() {
test.assertTitle("Google", "google homepage title is the one expected");
test.assertExists('form[action="/yahoo"]', "main form is found");
this.fill('form[action="/search"]', {
q: "casperjs"