This file contains hidden or 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
| >>> ''.join([chr(letter) for letter in range(97, 123) + range(65, 91)]) | |
| 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' |
This file contains hidden or 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
| dagrevis@itsmintitsmintwoot ~ # aptitude install skype | |
| The following NEW packages will be installed: | |
| bluez-alsa:i386{a} gcc-4.6-base:i386{a} glib-networking:i386{a} gstreamer0.10-plugins-base:i386{a} gstreamer0.10-plugins-good:i386{a} gstreamer0.10-x:i386{a} gtk2-engines:i386{a} gtk2-engines-murrine:i386{a} | |
| gtk2-engines-oxygen:i386{a} gtk2-engines-pixbuf:i386{a} gvfs:i386{a} gvfs-libs:i386{a} ia32-libs{a} ia32-libs-multiarch:i386{a} ibus-gtk:i386{a} lib32asound2{a} lib32gcc1{a} lib32stdc++6{a} libaa1:i386{a} libacl1:i386{a} | |
| libaio1:i386{a} libao-common{a} libao4:i386{a} libasn1-8-heimdal:i386{a} libasound2:i386{a} libasound2-plugins:i386{a} libasyncns0:i386{a} libatk1.0-0:i386{a} libattr1:i386{a} libaudio2:i386{a} libaudiofile1:i386{a} | |
| libavahi-client3:i386{a} libavahi-common-data:i386{a} libavahi-common3:i386{a} libavc1394-0:i386{a} libbz2-1.0:i386{a} libc6:i386{a} libc6-i386{a} libcaca0:i386{a} libcairo-gobject2:i386{a} libcairo2:i386{a} | |
| libcanberra-gtk-module:i386{a} libcanberra-gtk0:i386{a} |
This file contains hidden or 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
| [dagrevis@localhost myproject]$ bin/python myproject/manage.py test legacy | |
| Creating test database for alias 'default'... | |
| Creating test database for alias 'report_db'... | |
| Got an error creating the test database: (1007, "Can't create database 'test_myapp'; database exists") | |
| Type 'yes' if you would like to try deleting the test database 'test_myapp', or 'no' to cancel: yes | |
| Destroying old test database 'report_db'... | |
| Got an error recreating the test database: (1008, "Can't drop database 'test_myapp'; database doesn't exist") |
This file contains hidden or 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 pretty_html(html): | |
| from BeautifulSoup import BeautifulSoup | |
| soup = BeautifulSoup(html) | |
| return soup.prettify() |
This file contains hidden or 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
| @staticmethod | |
| def calculate_depth(comments, comment=None, depth_level=1): | |
| """ | |
| @brief Calculates depth of comments w/ recursion. | |
| @param comments: Comments | |
| @param comment: Comment (for recursion, isn't used from outside) | |
| @param depth_level: Depth level (for recursion, isn't used from outside) | |
| @return Comments /w depth level | |
| """ | |
| for the_comment in comments: |
This file contains hidden or 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 python2 | |
| import sys | |
| import argparse | |
| import BeautifulSoup | |
| def pretty_html(html): | |
| soup = BeautifulSoup.BeautifulSoup(html) | |
| return soup.prettify() |
This file contains hidden or 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 is_progressive(number): | |
| digits = map(int, list(str(number))) | |
| for i, digit in enumerate(digits): | |
| if i != 0: | |
| if digit <= digits[i - 1]: | |
| return False | |
| return True | |
| def next_progressive(number): |
This file contains hidden or 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 sh | |
| import signal | |
| class TooLongToWait(Exception): | |
| pass | |
| def alarm_handler(signum, frame): | |
| raise TooLongToWait |
This file contains hidden or 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
| foo = ( | |
| "lorem", | |
| "ipsum" | |
| "sit", | |
| "dolor", | |
| ) | |
| print foo[2] == "sit" # False | |
| foo = ( |
This file contains hidden or 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
| ;(function($) { | |
| $(function() { | |
| "use strict" | |
| var bookmarks = [ | |
| {url: "http://google.com/", title: "Google.com"}, | |
| {url: "http://dagrevis.lv/", title: "daGrevis.lv"} | |
| ] | |
| var Bookmark = Backbone.Model.extend({ | |
| defaults: { | |
| "times_visited": 0 |