Skip to content

Instantly share code, notes, and snippets.

View nautilebleu's full-sized avatar

Goulwen Reboux nautilebleu

View GitHub Profile
@nautilebleu
nautilebleu / gist:2953267
Created June 19, 2012 09:38
Use python 2.7 on Alwaysdata servers
# 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].
@nautilebleu
nautilebleu / gist:5822946
Created June 20, 2013 13:59
Objective-C fun
#import <Foundation/Foundation.h>
int main() {
NSRange range = [NULL rangeOfString:@"whatever"];
NSLog(@"%d", range);
if (range.location != NSNotFound)
{
NSLog(@"FOUND");
} else {
NSLog(@"NOT FOUND");
#!/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.
"""
@nautilebleu
nautilebleu / pluriel-français
Last active August 29, 2015 14:07
Apprendre le code (et aussi l'orthographe !)
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'