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
# In Your virtual env | |
pip install pipdeptree | |
# get all dependencies | |
pipdeptree | |
#copy / paste into SublimeText for example | |
# cmd + shift + F : httplib to search httplib |
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
# python2.7/site-packages/debug_toolbar/templates/debug_toolbar/panels/templates.html: | |
# L18 | |
<dd><samp><a href="file://{{ template.template.origin_name|addslashes }}">{{ template.template.origin_name|addslashes }}</a></samp></dd>` | |
# python2.7/site-packages/debug_toolbar/panels/request_vars.py | |
#L52 | |
from django.conf import settings | |
personal_path = ('file:///%s/%s.py') % ( | |
settings.HOME, | |
self.view_func.__module__.replace('.', '/')) |
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
#manufacturers{ | |
position:relative; | |
} | |
#manufacturers .sub-menu{ | |
width:auto; | |
min-width:auto; | |
} |
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.db import models | |
unique_fields = ['company_id', 'applicant_id'] | |
duplicates = (CertificationApplicantCompany.objects.values(*unique_fields) | |
.order_by() | |
.annotate(max_id=models.Max('id'), | |
count_id=models.Count('id')) | |
.filter(count_id__gt=1)) | |
for duplicate in duplicates: |
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.contrib.admin.util import NestedObjects | |
from django.db import DEFAULT_DB_ALIAS | |
from django.core import serializers | |
# flatten function | |
def flatten(xs): | |
result = [] | |
if isinstance(xs, (list, tuple)): |
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
/*! | |
* Bootstrap v3.0.0 | |
* | |
* Copyright 2013 Twitter, Inc | |
* Licensed under the Apache License v2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Designed and built with all the love in the world by @mdo and @fat. | |
*/ |
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.db.models import Count | |
ExamConvocation.objects.values('exam_id', 'applicant_id').annotate(Count('id')).order_by().filter(id__count__gt=1) | |
>> [{'exam_id': 10, 'applicant_id': 80, 'id__count': 2}, {'exam_id': 37, 'applicant_id': 364, 'id__count': 2}] |
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
<!doctype html> | |
<html lang="fr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Title Here</title> | |
<meta name="description" content="Description Here"> | |
<meta name="author" content="Author here"> | |
<link rel="stylesheet" href="path_to_css"> |
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
<?php | |
/** | |
* Super-simple, minimum abstraction MailChimp API v3 wrapper | |
* MailChimp API v3: http://developer.mailchimp.com | |
* This wrapper: https://github.com/drewm/mailchimp-api | |
* | |
* @author Drew McLellan <[email protected]> |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
NewerOlder