Skip to content

Instantly share code, notes, and snippets.

function resolve_tinyurl($tinyurl) {
$ch = curl_init($tinyurl);
curl_setopt($ch,CURLOPT_HEADER,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,false);
$data = curl_exec($ch);
preg_match('#Location: ([^\n\r]*)#i', $data, $matches);
// 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 = {};
var list=[];
for(var i = 0 ;i < 10 ; i++) {
list[i] = i*i;
}
response.object = {
version: 3.14,
square: list
};
/**
* 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;
/**
* 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;
/**
* Set up the inline importer
*/
Exhibit.InlineImporter = { };
Exhibit.importers["inline"]
= Exhibit.InlineImporter;
Exhibit.InlineImporter.load
= function(data, database, cont) {
Exhibit.UI.showBusyIndicator();
#!/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 November 17, 2010 08:57
Check a Gmail account for move notifications from Dragon Go Server (DGS) and sends a Prowl notification to my iPhone
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 November 18, 2010 08:58
Example on how to use the RForce gem with Salesforce SOQL queries
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 !