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 microdetector import detect_mobile | |
@detect_mobile | |
def my_mobile_view(request): | |
if request.mobile: | |
#do something with mobile |
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
#! /bin/sh | |
cd /usr/share/locales | |
./install-language-pack eo.UTF-8 | |
./install-language-pack ia.UTF-8 | |
./install-language-pack ie.UTF-8 | |
./install-language-pack io.UTF-8 | |
./install-language-pack vo.UTF-8 | |
./install-language-pack ca.UTF-8 | |
./install-language-pack fr_AD.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
from string import digits, ascii_letters | |
from random import choice | |
from sys import argv | |
def generator(length): | |
chac = digits + ascii_letters | |
pwd = list() | |
for p in range(length): | |
pwd.append(choice(chac)) | |
print("".join(pwd)) |
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 string import digits, ascii_letters | |
from random import choice | |
from sys import argv | |
def generator(length): | |
chac = digits + ascii_letters | |
pwd = list() | |
for p in range(length): | |
pwd.append(choice(chac)) | |
print("".join(pwd)) |
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 autoregister(*app_list): | |
from django.db.models import get_models, get_app | |
from django.contrib import admin | |
from django.contrib.admin.sites import AlreadyRegistered | |
for app_name in app_list: | |
app_models = get_app(app_name) | |
for model in get_models(app_models): | |
try: | |
admin.site.register(model) | |
except AlreadyRegistered: |
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 gdata.photos.service | |
import gdata.media | |
import gdata.geo | |
import getpass | |
class Picasa: | |
def upload(self,filename, title): | |
gd_client = gdata.photos.service.PhotosService() |
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
./blogger.py 'Hello World!' "First post from command line through Google's Blogger API ^^" |
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 pyknon.genmidi import Midi | |
from pyknon.music import NoteSeq | |
notes1 = NoteSeq("D4 F#8 A Bb4") | |
midi = Midi(1, tempo=90) | |
midi.seq_notes(notes1, track=0) | |
midi.write("demo.mid") |
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 -*- | |
import requests as request | |
import sys | |
class Requester: | |
def __init__(self, flood_max, url): |
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
<html> | |
<head> | |
<style type="text/css"> | |
#containername { | |
background-color:red; | |
width: 500; | |
height: 500; | |
} | |
</style> | |
</head> |
OlderNewer