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 datetime | |
from django.conf import settings | |
from django.contrib.auth import logout | |
from django.contrib.auth.models import User | |
from django.contrib.sessions.models import Session | |
from django.http import HttpRequest | |
from django.utils.importlib import import_module | |
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
>> ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'].map! {|x| Integer(x)} | |
ArgumentError: invalid value for Integer: "08" | |
from (irb):1:in `Integer' | |
from (irb):1 | |
from (irb):1:in `map!' | |
from (irb):1 | |
>> ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'].map! {|x| Integer(Float(x))} | |
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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 | |
# | |
# Script to check who of your Facebook friends were removed from FB or unfriend | |
# you. | |
# | |
# Requirements | |
# ============ | |
# | |
# * Linux / Mac OS X / other Unix | |
# * `Python <http://www.python.org/>`_ 2.6 or 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
from wtforms.fields import SelectField as BaseSelectField | |
from wtforms.validators import ValidationError | |
from wtforms.widgets import HTMLString, html_params, escape | |
from wtforms.widgets import Select as BaseSelectWidget | |
__all__ = ('SelectField', 'SelectWidget') | |
class SelectWidget(BaseSelectWidget): |
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 unittest | |
from decimal import Decimal | |
from random import randint | |
class TestRandDecimal(unittest.TestCase): | |
def check(self, a, b): | |
value = randdecimal(a, b) |
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 | |
# | |
# Additional wrapper to ``rsync`` command with profiles. | |
# | |
# Requirements | |
# ============ | |
# | |
# * Python_ 2.4 or higher | |
# * rsync_ | |
# |
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 | |
# | |
# Script to pull fresh XBMC source, compile and install it. | |
# | |
# Requirements | |
# ============ | |
# | |
# * Cloned XBMC git repo | |
# * All requirements for build XBMC from source | |
# * git |
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 | |
# | |
# Simple script to clean (remove) all thumbnails for sites placed at "Most | |
# visited" section of Google Chrome or Chromium new page. | |
# | |
# Installation | |
# ============ | |
# | |
# Store this script somewhere in your ``$PATH`` (like ``~/bin/`` or | |
# ``/usr/local``). |
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 django.conf import settings | |
from django.db import models | |
from django.utils.encoding import smart_str | |
if hasattr(settings, 'USE_CPICKLE'): | |
import cPickle as pickle | |
else: | |
import pickle | |
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 | |
""" | |
Bootstrap project using virtualenv_ and pip_. This script will create new | |
virtual environment if needed and will install all requirements there. | |
.. _virtualenv: http://pypi.python.org/pypi/virtualenv | |
.. _pip: http://pypi.python.org/pypi/pip | |
""" |