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
| #don't multiply queryset for user.get_profile... | |
| #coworkers is a queryset of User | |
| coworkers_id = set([c.id for c in coworkers]) | |
| from users_profiles.models import UserProfile | |
| profiles = UserProfile.objects.filter(user__in=coworkers_id) | |
| co_profiles = dict((u.id, u) for u in profiles) | |
| for co in coworkers: | |
| co.get_profile = co_profiles.get(co.id) |
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
| Don’t do: | |
| pub_id = b.publisher.id | |
| Do do: | |
| pub_id = b.publisher_id |
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 -*- | |
| import os | |
| import time | |
| from multiprocessing import Process | |
| from django.template.loader import render_to_string | |
| from django.http import HttpRequest | |
| from django.template import RequestContext | |
| from django.contrib.auth.models import User |
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
| body { | |
| width: auto!important; | |
| margin: auto!important; | |
| font-family: serif; | |
| font-size: 12pt; | |
| background-color: #fff!important; | |
| color: #000!important; | |
| } | |
| p, h1, h2, h3, h4, h5, h6, blockquote, ul, ol { | |
| color: #000!important; |
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
| openssl rsa -in private_key.key -out private_key_without_paraphrase.key |
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
| ### in signals.py ################################## | |
| #################################################### | |
| def project_post_generate_template(sender, **kwargs): | |
| ### get object ### | |
| project = kwargs['instance'] | |
| generate_project_cartridge(project) | |
| def generate_project_cartridge(project): | |
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
| class FooBar(models.Model): | |
| foo = models.ForeignKey(Foo) | |
| bar = models.ForeignKey(Bar, null=True, blank=True) | |
| class Meta: | |
| unique_together = ('foo', 'bar') | |
| def clean(self): | |
| from django.core.exceptions import ValidationError | |
| if self.foo and FooBar.objects.filter(name=self.bar).exists(): |
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
| # ~.gitconfig | |
| [user] | |
| name = Samuel Martin | |
| email = samuel.martin@temesis.com | |
| [color] | |
| diff = auto | |
| status = auto | |
| branch = auto | |
| [alias] | |
| st = status |
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
| - Après avoir forké le dépôt de "Jedi" (via bouton Fork ) | |
| - Utiliser le dépôt sur votre machine via : git clone https://github.com/<your_name>/<project_name>.git donc git clone https://github.com/padawan/laser.git | |
| - Amusez vous dans votre dépôt ... | |
| - Rohh jedi à mise à jour son sabre laser comment faire, je veux aussi cette hype mise à jour ? | |
| git remote add jedi git://github.com/jedi/laser.git | |
| git pull jedi master | |
| git push | |
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
| In terminal: | |
| * sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa | |
| * sudo apt-get update | |
| * sudo apt-get install firefox-4.0 |
OlderNewer