This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.textspinner = function(options) { | |
var defaults = { | |
fadeInTime: 200, | |
fadeOutTime: 200, | |
showDelay: 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* log into firebug/firephp extensions | |
* | |
* @see http://www.firephp.org | |
* @example | |
firephp($var); | |
firephp($var, LOG_ERR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 <[email protected]>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$DESTINATAIRE = '[email protected]'; | |
$SUJET = 'Message reçu depuis '.$_SERVER['HTTP_HOST'].' '; | |
function valid_email($email) { | |
$atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; | |
$domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; | |
$regex = '/^' . $atom . '+' . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Start XML file, create parent node | |
$xml = new XMLWriter(); | |
$xml->openMemory(); // create document in memory (AKA storing into a var) | |
$xml->setIndent(true); // autoindent output | |
$xml->setIndentString(' '); // set kind of indentation | |
$xml->startDocument('1.0','UTF-8'); // start xml declaration with encoding utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pass = (chr((int)rand(97,122))).(chr((int)rand(67,90))).(rand(1000,9999)); |