Skip to content

Instantly share code, notes, and snippets.

View harobed's full-sized avatar
💭
CTO at Spacefill

Stéphane Klein harobed

💭
CTO at Spacefill
View GitHub Profile
@harobed
harobed / gist:5777518
Last active December 18, 2015 11:39 — forked from athoune/gist:5777474
#!/usr/bin/env python
import sys
# Lamson is an application, but also the best way to read email without
# struggling with "battery include" libraries.
from lamson.encoding import from_string
from pyelasticsearch import ElasticSearch
from pyelasticsearch.exceptions import ElasticHttpNotFoundError
@harobed
harobed / gist:3905215
Created October 17, 2012 12:09
Append client scripts in casperjs
var casper = casperjs.create({
verbose: true,
logLevel: "error",
clientScripts: [
'jquery.js',
'jquery.simulate.js',
'jquery.simulate.ext.js',
'jquery.simulate.drag-n-drop.js',
'jquery.simulate.key-combo.js',
'jquery.simulate.key-sequence.js'
@harobed
harobed / gist:3905199
Created October 17, 2012 12:07
How to use jQuery simulate with CasperJS
casper.then(function() {
this.test.assertEval(function() {
$('[name="name"]').simulate("key-sequence", {sequence: "{selectall}Foobar"});
return $('.title').text() == 'Foobar';
});
});
@harobed
harobed / gist:3713283
Created September 13, 2012 09:49
Mon programme au PyCon FR 2012
Samedi matin :
* Processus de développement de CPython (Antoine Pitrou)
* La boite à outils pour Django (Ordoquy Xavier)
* Picasso, le polyglotte et le philosophe (Marc Chantreux)
* Je configure mes serveurs avec fabric et fabtools (Ronan Amicel)
Samedi après midi :
* OpenERP : gestion d'entreprise Open Source en Python (Alexandre ALLOUCHE)
@harobed
harobed / How to fill dict attribute with Factory-boy ?
Created June 27, 2012 08:49
How to fill dict attribute with Factory-boy ?
class UserFactory(factory.Factory):
FACTORY_FOR = User
first_name = factory.InfiniteIterator([ 'Peggie', 'Gabe', 'King', 'Fredy', 'Ole', 'Vernice' ])
last_name = factory.InfiniteIterator([ 'Leannon', 'Barton', 'Sauer', 'Walker', 'Strosin'])
username = factory.LazyAttribute(
lambda o: '%s.%s@example.com' % (o.first_name.lower(), o.last_name.lower())
)
# How can I feed data in dict, metadata isn't another Entities (MongoDB context)