Skip to content

Instantly share code, notes, and snippets.

View gist:106224
// Defini la structure des pages et le xpath pour recuperer les donnees
var xpath = '//table[@class="sobi2Listing"]/tr//td';
var baseUrl = "http://www.abcvert.fr/annuaire/energies-renouvelables/solaire";
var getUrl = function(pageIndex) {
return baseUrl + ((pageIndex == 0) ? ".html" : "/Page-"+(pageIndex+1)+".html");
};
// Recuperation des contacts
var contacts = {};
View gist:106503
var list=[];
for(var i = 0 ;i < 10 ; i++) {
list[i] = i*i;
}
response.object = {
version: 3.14,
square: list
};
View Permalink example
View gist:324642
/**
* Methods to persist the tooltip if we are hovering over the tooltip element
*/
YAHOO.util.Event.addListener(this.tooltip.element, "mouseover", function(e,obj) {
if (this.hideProcId) {
clearTimeout(this.hideProcId);
this.hideProcId = null;
View yui2-PersistingTooltip.js
/**
* Methods to persist the tooltip if we are hovering over the tooltip element
*/
YAHOO.util.Event.addListener(this.tooltip.element, "mouseover", function(e,obj) {
if (this.hideProcId) {
clearTimeout(this.hideProcId);
this.hideProcId = null;
View exhibit-importers.js
/**
* Set up the inline importer
*/
Exhibit.InlineImporter = { };
Exhibit.importers["inline"]
= Exhibit.InlineImporter;
Exhibit.InlineImporter.load
= function(data, database, cont) {
Exhibit.UI.showBusyIndicator();
View Raphael-foreign-object.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script>
window.onload = function() {
// Inserting foreignObject into the markup svg
var g = document.getElementById("g");
View setup github project
#!/bin/sh
git init
git add *
git commit -m 'first commit'
git remote add origin git@github.com:neyric/$1.git
git push origin master
# Create the gh-pages branch to serve the files from GitHub
git branch gh-pages
@ericabouaf
ericabouaf / gmail2prowl.rb
Created Nov 17, 2010
Check a Gmail account for move notifications from Dragon Go Server (DGS) and sends a Prowl notification to my iPhone
View gmail2prowl.rb
require 'rubygems'
require 'gmail'
require 'prowl'
gmail = Gmail.new('eric.****@gmail.com', '****')
emails = gmail.inbox.emails(:unread, :from => "noreply@dragongoserver.net")
if emails.size > 0
email = emails.first
@ericabouaf
ericabouaf / rforce_query_example.rb
Created Nov 18, 2010
Example on how to use the RForce gem with Salesforce SOQL queries
View rforce_query_example.rb
require 'rubygems'
require 'rforce'
require 'base64'
# Install:
# sudo gem install rforce
# sudo gem install facets -v 2.4
#
# Important: rforce 0.4.1 is not compatible with facets 2.9 !