Skip to content

Instantly share code, notes, and snippets.

View ebrehault's full-sized avatar

Eric BREHAULT ebrehault

View GitHub Profile
@ebrehault
ebrehault / gist:4954392
Created February 14, 2013 17:17
casper drag&drop not working with leaflet
//==============================================================================
// Casper generated Thu Feb 14 2013 18:15:16 GMT+0100 (CET)
//==============================================================================
var x = require('casper').selectXPath;
var casper = require('casper').create();
casper.options.viewportSize = {width: 1615, height: 964};
casper.start('http://leafletjs.com/');
casper.then(function() {
@ebrehault
ebrehault / gist:4961393
Created February 15, 2013 16:13
Casperjs issues with SVG
//==============================================================================
// Casper generated Fri Feb 15 2013 14:10:44 GMT+0100 (CET)
//==============================================================================
var x = require('casper').selectXPath;
var casper = require('casper').create();
casper.options.viewportSize = {width: 1615, height: 964};
// THIS ONE PRODUCES A BAD SCREENSHOT:
casper.start('http://raphaeljs.com/pie.html');
@ebrehault
ebrehault / gist:4976059
Created February 18, 2013 09:03
phantomjs svg rendering
var page = require('webpage').create();
page.open('http://raphaeljs.com/github/dots.html', function () {
page.render('screen2.png');
phantom.exit();
});
db = context.getParentDatabase()
file_path = db.getDocument("annonces_path").configValues.encode('ascii')
photos_path = db.getDocument("photos_path").configValues.encode('ascii')
annonces_file = open_url("file://"+file_path, asFile=True)
csv_data = csv_to_array(annonces_file, delimiter="#")
csv_data = csv_data[1:]
mapping_main = {
'annonce_reference': 0,
'annonce_type': 1,
//==============================================================================
// Casper generated Mon Jun 10 2013 10:09:49 GMT+0200 (CEST)
//==============================================================================
var x = require('casper').selectXPath;
var casper = require('casper').create();
casper.options.viewportSize = {width: 1615, height: 928};
casper.start('http://wetter.orf.at/oes/');
casper.waitForSelector(".mapNavigation li:nth-child(2) div",
function success() {
@ebrehault
ebrehault / gist:6027283
Created July 18, 2013 07:09
plomino db sample to index docs in portal catalog's Subject index
<plominodatabase id="test-subjects">
<design>
<dbsettings version="1.16">
<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">True</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
{
"games": [
{
"url": "https://api.github.com/gists/5061965",
"id": "5061965",
"white": "Riveen",
"black": "mephux",
"result": "0-1"
}
]
@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"
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 / 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() {