Skip to content

Instantly share code, notes, and snippets.

View luxifer's full-sized avatar
:shipit:
Gopher of the GitHub swamp

Florent Viel luxifer

:shipit:
Gopher of the GitHub swamp
View GitHub Profile
function modifieTexte() {
var t2 = document.getElementById("t2");
t2.firstChild.nodeValue = "trois";
}
function load() {
var el = document.getElementById("t");
el.addEventListener("click", modifieTexte, false); //ne marche pas
}
function modifieTexte() {
var t2 = document.getElementById("t2");
t2.firstChild.nodeValue = "trois";
}
function load() {
var el = document.getElementById("t");
el.attachEvent("onclick", modifieTexte);
}
<?php
$start_request = microtime(true);
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('front', 'dev', true);
sfContext::createInstance($configuration)->dispatch();
$enable_graphite = sfConfig::get('app_enable_graphite');
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@luxifer
luxifer / demo.php
Created August 2, 2012 08:56
Mail Attachment management demo
#!/usr/bin/env php
<?php
require_once("attachmentread.class.php");
$host="{host:port/params}BOX"; // voir http://fr.php.net/imap_open
$login=""; //imap login
$password=""; //imap password
$savedirpath="./" ; // attachement will save in same directory where scripts run othrwise give abs path
$jk=new MailAttachmentManager($host, $login, $password, $savedirpath); // Creating instance of class####
?>
@luxifer
luxifer / MailAttachmentManager.class.php
Created August 2, 2012 08:40
Mail Attachment management
<?php
/**
* @author Florent Viel
*/
class MailAttachmentManager
{
/**
* @var string {host:port\params}BOX voir http://fr.php.net/imap_open
*/
@luxifer
luxifer / index.php
Created March 28, 2012 15:13
php controller in 14 lines
<?php
if (!empty($_GET['p']))
{
if (is_file($_GET['p'].".php"))
{
include($_GET['p'] . ".php");
}
else
{
echo 'error';