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
| # coding=UTF-8 | |
| from __future__ import division | |
| import re | |
| # This is a naive text summarization algorithm | |
| # Created by Shlomi Babluki | |
| # April, 2013 | |
| class SummaryTool(object): |
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
| git commit --amend | |
| more info: http://git-scm.com/book/en/Git-Basics-Undoing-Things |
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
| # O select você faz normal usando o 'using' para indicar a database específica | |
| # algo como: Usuario.objects.using('database_test') | |
| from django import forms | |
| # ... | |
| class UsuarioForm(forms.ModelForm): | |
| def __init__(self, *args, **kwargs): | |
| super(ContentForm, self).__init__(*args, **kwargs) | |
| self.fields["user"].queryset = Usuario.objects.using('database_test') |
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
| The solution is: | |
| Update your virtualenv and re-create your virtualenvs, by passing the path of an existing virtualenv dir. | |
| http://www.guyrutenberg.com/2012/05/30/fixing-virtualenv-after-upgrading-your-distributionpython/ |
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
| {{ variable|stringformat:"02d" }} |
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 random | |
| import unittest | |
| import HTMLTestRunner | |
| class TestSequenceFunctions(unittest.TestCase): | |
| def setUp(self): | |
| self.seq = range(10) |
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
| # This is a really old post, in the comments (and stackoverflow too) you'll find better solutions. | |
| def find(key, dictionary): | |
| for k, v in dictionary.iteritems(): | |
| if k == key: | |
| yield v | |
| elif isinstance(v, dict): | |
| for result in find(key, v): | |
| yield result | |
| elif isinstance(v, list): |
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
| https://extensions.gnome.org/extension/37/quicklaunch/ | |
| https://extensions.gnome.org/extension/354/maximus/ | |
| https://extensions.gnome.org/extension/307/dash-to-dock/ | |
| https://extensions.gnome.org/extension/2/move-clock/ |
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
| sudo add-apt-repository ppa:videolan/stable-daily | |
| sudo apt-get update | |
| sudo apt-get install vlc |
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
| hello new gist :) |