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
def donne_le_pluriel(nom): | |
si nom.finit_par('x') ou nom.finit_par('z'): | |
retourne nom | |
sinon si nom.finit_par('al'): | |
retourne nom[:-2] + 'aux' | |
sinon si nom.finit_par('ail'): | |
retourne nom[:-3] + 'aux' | |
sinon si nom.finit_par('ou'): | |
si nom.dans(['bijou', 'caillou', 'chou', 'genou', 'hibou', 'joujou', 'pou', 'ripou']): | |
retourne nom + '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
#!/usr/bin/env python | |
""" | |
parsedatetime constants and helper functions to determine | |
regex values from Locale information if present. | |
Also contains the internal Locale classes to give some sane | |
defaults if PyICU is not found. | |
""" |
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
#import <Foundation/Foundation.h> | |
int main() { | |
NSRange range = [NULL rangeOfString:@"whatever"]; | |
NSLog(@"%d", range); | |
if (range.location != NSNotFound) | |
{ | |
NSLog(@"FOUND"); | |
} else { | |
NSLog(@"NOT FOUND"); |
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
# Get the binary from ActiveState. | |
$ wget http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz | |
# Create a src directory at the root of your account. | |
$ mkdir src | |
# Install python 2.7 | |
$ ActivePython-2.7.2.5-linux-x86/install.sh | |
# The installer will prompt you to choose a directory. As the default is /opt/ActivePython-2.7, choose | |
# the previously created directory. | |
Enter directory in which to install ActivePython. Leave blank and | |
press 'Enter' to use the default [/opt/ActivePython-2.7]. |
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
# | |
# Environment variables | |
# | |
# set PATH and PYTHONPATH to use Homebrew | |
set PATH /usr/local/Cellar /usr/local/bin /usr/local/sbin /usr/local/share/python $PATH | |
set PYTHONPATH /usr/local/lib/python $PYTHONPATH | |
set BROWSER 'open' | |
# |
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
# in /path/to/venv/bin/activate.fish | |
# replace | |
set -l oldpromptfile (tempfile) | |
#by | |
set -l oldpromptfile (mktemp -t tmp.oldpromptcontents.XXXX) |
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 | |
// classes/Db.php | |
abstract class Db | |
{ | |
//[…] | |
private static $_blacklist = 'LOAD_FILE|UNION|OUTFILE|DUMPFILE|ESCAPED|TERMINATED|CASCADE|INFILE|X509|TRIGGER|REVOKE'; | |
//[…] | |
} |
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 | |
// http://svn.prestashop.com/trunk/classes/Module.php | |
$file = trim(file_get_contents(_PS_MODULE_DIR_.$module.'/'.$module.'.php')); | |
if (substr($file, 0, 5) == '<?php') | |
$file = substr($file, 5); | |
if (substr($file, -2) == '?>') | |
$file = substr($file, 0, -2); | |
if (class_exists($module, false) OR eval($file) !== 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
def _cmp(a, b): | |
if a[0].rfind(b[0]) == 0: | |
return -1 | |
elif a[0].rfind(b[0]) == -1: | |
if a[0] < b[0] : | |
return -1 | |
return 1 | |
else: | |
return 0 |
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
class Conf: | |
class Map: | |
special_topics = { | |
'learning_objects': 'Objets d\'Apprentissage', | |
'authors': 'Auteur', | |
'footer_files': 'Barre de navigation', | |
} | |
class Package: | |
skeleton = 'conf/package/skeleton' | |
class Externals: |
NewerOlder