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
# Detect mobile device. Set to mobile view if available | |
from mobile.sniffer.detect import detect_mobile_browser | |
if detect_mobile_browser(request.env.http_user_agent): | |
mobile_view = '%s.mobile.%s' % (request.function, request.extension) | |
if os.path.exists(os.path.join(request.folder, 'views',request.controller, mobile_view)): | |
response.view = '%s/%s' % (request.controller, mobile_view) |
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
Global setup: | |
Set up git | |
git config --global user.name "Orestes Sanchez" | |
git config --global user.email [email protected] | |
Next steps: | |
mkdir Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
cd Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
git init | |
touch README |
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
Global setup: | |
Set up git | |
git config --global user.name "Orestes Sanchez" | |
git config --global user.email [email protected] | |
Next steps: | |
mkdir Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
cd Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
git init | |
touch README |
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 new_user(first_name, last_name, email, passw): | |
users = db(db.auth_user.email==email).select() | |
if users: | |
return users[0].id | |
else: | |
my_crypt = CRYPT(key=auth.settings.hmac_key) | |
crypt_pass = my_crypt(passw)[0] | |
id_user= db.auth_user.insert( | |
first_name=first_name, | |
last_name=last_name, |
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
# coding: utf8 | |
""" | |
Perseus users module | |
Author : Alvaro Lizama Molina <[email protected]> | |
Copyright (c) 2011, Alvaro Lizama Molina. | |
""" | |
################################################## | |
### Users |
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 new_user(first_name, last_name, email, passw): | |
users = db(db.auth_user.email==email).select() | |
if users: | |
return users[0].id | |
else: | |
my_crypt = CRYPT(key=auth.settings.hmac_key) | |
crypt_pass = my_crypt(passw)[0] | |
id_user= db.auth_user.insert( | |
first_name=first_name, | |
last_name=last_name, |
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 | |
# -*- coding: utf-8 -*- | |
__author__ = "Deepak.G.R." | |
__license__ = 'Public Domain' | |
""" | |
usage: | |
Go to command line and type | |
python ai-class.py "topic-name" |
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 | |
# coding=utf-8 | |
# Python version of Zach Holman's "spark" | |
# https://github.com/holman/spark | |
# by Stefan van der Walt <[email protected]> | |
""" | |
USAGE: |
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
# ##### BEGIN GPL LICENSE BLOCK ##### | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
# Take r, g and b channels from separate images. Python randomises the list for extra fun. | |
from PIL import Image | |
import os, math, sys, random | |
os.chdir(sys.argv[1]) | |
fileList = os.listdir(".") | |
random.shuffle(fileList) | |
(width, height) = Image.open(fileList[0]).size | |
nPhotos = len(fileList) | |
dst = Image.new("RGB", (width, height)) | |
fileNum = 0 |
OlderNewer