Skip to content

Instantly share code, notes, and snippets.

View evaisse's full-sized avatar

Emmanuel Vaïsse evaisse

  • none
  • Nancy, France
View GitHub Profile
RewriteCond %{QUERY_STRING} reload [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^plugins/thumbs/img/([a-z]+)-([1-9][0-9]*)x([1-9][0-9]*)-(.*)$ /plugins/thumbs/thumb.php/$1/$2/$3/?file=$4 [L]
<?php #-*- coding: utf-8 -*-
/**
* Format and translit a string like "The Fantastic ~'étonnante' permalink url" => "the-fantastic-etonnante-permalink-url"
*
* @param string $string string to
* @param bool $dot_allowed allow dots (only one) chars in url
* @return string
*/
function urlize($string, $dot_allowed=false) {
#!/usr/bin/python
"""Usage: python flickrset2backup.py api_key photoset_id /path/to/backup/folder
find your set id in the set url
http://www.flickr.com/photos/evaisse/sets/72157602716593936/
get userid with idgetr http://idgettr.com/
ex : ./flickrset2backup.py 4c2f9a5259c09c04c2fcd2a7 \
72157602716593936 ./backup
"""
__author__ = "Emmanuel Vaisse <evaisse@gmail.com>"
<?php #-*- coding: utf-8 -*-
/**
* Unaccent the input string string. An example string like `ÀØėÿᾜὨζὅБю`
* will be translated to `AOeyIOzoBY`
*
* @param string $str
*
* @return string unaccented string
*/
@evaisse
evaisse / firephp.php
Created April 1, 2010 10:42
log into firebug/firephp extensions
<?php
/**
* log into firebug/firephp extensions
*
* @see http://www.firephp.org
* @example
firephp($var);
firephp($var, LOG_ERR);
(function($){
$.fn.textspinner = function(options) {
var defaults = {
fadeInTime: 200,
fadeOutTime: 200,
showDelay: 200
from models import Ent
def randomstr():
import random
alphabet = u'abcdefghijklmnopq rstuvwxyzéièùïà\'"'
alphabet + alphabet.upper()
string=''
for count in xrange(1,50):
for x in random.sample(alphabet,random.randint(1,15)):
string+=x
<?php
$form = Form::create()->setMethod(Form::POST);
$form->addTextField('name', 'Name')->validRequired();
$form->addTextField('age', 'Age')->validNumeric();
$form->addSelectFIeld('rank','Rank :')->setOptions( 'User', 'Admin', 'Unknow' );
$form->addTextField('autre_fonction', 'Autre fonction:');
$form->addTextAreaField('adresse','Adresse:');
$form->addNumericField('code_postal','Code postal:')->setAttribute('size',5)->validSize(5);
$form->addTextField('tel_perso','Téléphone personnel:')->validPhoneNumber();
/**
* get French date
*
* @example
* frenchDate(); // Lundi 13 Octobre
*
* @param date {Date} a date object, if none provided, now() is used
* @returns {String}
*/
@evaisse
evaisse / whatis.rb
Created December 3, 2010 16:46
A sample Grammar
Struct.Import
a(): 5,6,7
#
IF
a(): ENDDEF ()