Skip to content

Instantly share code, notes, and snippets.

View AlSquire's full-sized avatar

Arnaud Lécuyer AlSquire

View GitHub Profile
class Fixnum
def add_toto(val)
return "la tete a toto" if val == 0 && self == 0
old_add(val)
end
alias old_add :"+"
alias :"+" add_toto
end
@AlSquire
AlSquire / super_hyper_simple_rss_reader.php
Created April 13, 2009 16:53
Parse juste un seul flux Rss, ya rien à voir, circulez ^^
<?php
// Parse juste un seul flux Rss, ya rien à voir, circulez ^^
$url = "http://alsquire.tumblr.com/rss"; // A remplacer
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-style-type" content="text/css" />
@AlSquire
AlSquire / velib.php
Created April 9, 2009 09:53
Etat des stations velib en indiquant le numéro de station.
<html>
<head><title>Hihi Velib !</title></head>
<body>
<?php
//TODO: show time, in order to check that the page have fresh data + refresh link on it
function get_station_datas($station_number) {
$url = "http://www.velib.paris.fr/service/stationdetails/{$station_number}";
$xml = simplexml_load_file($url);
<div class="help">
<h1>Help for you !</h1>
<p><%= yield %></p>
</div>
Testouille de push sur github.
Wesh wesh !
Devinette :
Que faire quand une blonde vous envoie une grenade ?
Réponse :
La dégoupiller et lui renvoyer !