Skip to content

Instantly share code, notes, and snippets.

<?php
 
set_time_limit(0);
 
/*
 * Okay, the project is LIFE.php so we want to skip all the boring pre-life part.
 * Thanks to php, we can just do a 5 billion years sleep.
 *
 */
define('YEAR',3600*24*365);
<?
//ON INCLUS TOUTES LES VARIABLES NECESSAIRE A BIXI
//require_once ("../../path.inc.php");
////////////////////////////////////////////////////////////////
//ini_set(allow_url_fopen, 1);
function getAllStationsWithoutId(){
$in="https://profil.bixi.ca/data/bikeStations.xml";
$content= file_get_contents($in);
$xml=new SimpleXMLElement($content);
//Cr�ation d un tableau tres accessible
@dmongeau
dmongeau / popunder.js
Created October 13, 2011 18:51
Pop under
function winClose()
{
window.top.opener=null;
window.close();
}
function closeWindow()
{
window.open('','_parent','');
window.close();
@dmongeau
dmongeau / server.js
Created March 30, 2012 20:09
Forward tweets to SMS using node.js, Twilio and Twitter stream api
/*
*
*
* Forward tweets to SMS in realtime
*
*
*/
var TWILIO_ACCOUNT_SID = ''; //Twilio Account SID
var TWILIO_AUTH_TOKEN = ''; //Twilio AUTH Token
@dmongeau
dmongeau / say.php
Created October 12, 2012 15:32
Text to speech
<?php
header('Content-type: audio/mpeg;');
system('espeak -v fr '.escapeshellarg($_REQUEST['text']).' --stdout | lame --quiet - -');
exit();
@dmongeau
dmongeau / zoom.js
Created January 4, 2013 20:21
Zoom on mouse position
var toggle = true;
function mouseFlicker(e) {
if(toggle) {
var multiplier = Math.round(Math.random()*1)+3;
var width = window.innerHeight*wish.imageRatio;
var height = window.innerHeight;
var newWidth = width*multiplier;
@dmongeau
dmongeau / console.js
Created February 13, 2013 14:38
À mettre dans le head pour éviter les erreurs de console.log dans IE
// Avoid `console` errors in browsers that lack a console.
(function(){for(var a,e=function(){},b="assert clear count debug dir dirxml error exception group groupCollapsed groupEnd info log markTimeline profile profileEnd table time timeEnd timeStamp trace warn".split(" "),c=b.length,d=window.console=window.console||{};c--;)a=b[c],d[a]||(d[a]=e)})();
@dmongeau
dmongeau / main.js
Last active December 15, 2015 18:09
require.config({
paths: {
jquery: '../components/jquery/jquery',
underscore: '../components/underscore/underscore',
preloadjs: '../components/scenejs/vendor/preloadjs'
},
shim: {
underscore: {
exports: '_'
},
<?php
$eventsRebuilded = array();
foreach($events as $event) {
foreach($event->dates as $date) {
$datestart = date('Y-m-d',strtotime($date->datestart));
if(!isset($eventsRebuilded[$date->datestart])) {
$eventsRebuilded[$date->datestart] = array();
}
$('body').append('<iframe src="about:blank" name="extractIframe" id="extractIframe"></iframe>')
$('form[name=MyArchivedPlaylistsForm]').attr('target','extractIframe');
var binded = false;
var rowIndex = 1;
function loadNext() {
if(!binded) {
$('#extractIframe').bind('load',function() {
console.log('loaded');
if(!$('#extractIframe').contents().find('form[name=PlaylistContentForm] table').length) {
return;