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
""" ldap_auth.py (custom methods for django_python3_ldap) | |
Create three additional groups in LDAP directory (e.g w/ prefix "django_"): | |
* cn=django_my_django_project,ou=groups,dc=example.com,dc=com | |
* cn=django_my_django_project_staff,ou=groups,dc=example.com,dc=com | |
* cn=django_my_django_project_superuser,ou=groups,dc=example.com,dc=com | |
1) "django_my_django_project" | |
Add all users to this group that should be able to use the Django APP. | |
The users will then be able to authenticate and their attributes will be synched. |
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
/** | |
* LESS stylesheet loader. | |
* | |
* Load a LESS stylesheet using style!main.less . This will load | |
* a stylesheet on the path ../css/main.less, compile it to CSS, | |
* and inject it in the page. | |
* | |
* During the optimization step with r.js, the stylesheet will be | |
* inlined with the javascript file. | |
* |
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
-----BEGIN PGP SIGNED MESSAGE----- | |
Hash: SHA1 | |
Dave Hall 20/01/2014 | |
-----BEGIN PGP SIGNATURE----- | |
Comment: GPGTools - http://gpgtools.org | |
iQEcBAEBAgAGBQJS3YYEAAoJEIayWs+cr8YFXD8H/j/K0yjIW/gOalmT5sW8twk6 | |
AfL9cJ4/PjM5wDnB3s879Wr4+OjHfIocwGt5czd8c2xqdo3t4EvySnBKRivDafx4 | |
bNhqiXBGApGiA0fCgxGBSSBdAo4SDtTO7qMmDb0TiGXjg33j83TX1AiY/M0IyobO |
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
def search(request): | |
search_form = SearchForm(request.GET) | |
if search_form.is_valid(): | |
data = form.cleaned_data | |
search_results = watson.filter(Issue, data["q"]).filter( | |
date__gte = data["start_date"], | |
date__lte = data["end_date"], | |
item__name = data["item_name"], | |
) |
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
.spinner-count { | |
&:after { | |
content: "servings"; | |
} | |
} | |
&.spinner-count-1 { | |
.spinner-count { | |
&:after { | |
content: "serving"; | |
} |
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
/** | |
* LESS stylesheet loader. | |
*/ | |
define([ | |
"module", | |
"text" | |
], function( | |
module, | |
text |
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 tempfile, re, codecs | |
from contextlib import closing | |
from functools import partial | |
RE_UNICODE_CONDOM = re.compile(u"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD]") | |
MEMORY_BUFFER_SIZE = 1024 * 1024 # 1M | |
CHUNK_SIZE = 1024 * 512 # 0.5M |
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
return not any ( | |
frozenset(permissions_grant).difference(chain.from_iterable( | |
parent_permissions_grant | |
for parent_model_grant, parent_permissions_grant | |
in parent_scope | |
if all( | |
parent_model_grant_part == model_grant_part | |
for model_grant_part, parent_model_grant_part | |
in izip_longest( | |
model_grant, |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG/MacGPG2 v2.0.19 (Darwin) | |
mQENBE228RIBCACuc/n1SvMxe7RQWrgOK4Hi1Pn8K9KcZNy0j+kmk319/W8GiqAC | |
qOKMcVIl+KA4zBy7KwCUkkEFUEJn4OwQky9NIyAJw7djyWkkMAAGSqvRWrbt+TF4 | |
AOje8EHJTF5r+4tytLRAHl7sRAHkBWdvPJKp5I9KLjbDu55q65dj8Gkjd0lKxk5n | |
b5IDTn5p3tx82j+DokdJ8YnmGq4fXtG6oUmi+EXlKV24Jo3+mlrNo3MKBMMQekuO | |
WJLhldnJiapnkaadDKqpiJ+7thPoemou4qizqxHaSZCmThegNzA+kP9sseM1YDk5 | |
kcy2xvxQu77BMpZ3s2zc2vviDY4S9/WMIRWnABEBAAG0HERhdmUgSGFsbCA8ZGF2 | |
ZUBldGlhbmVuLmNvbT6JATsEEwECACUCGy8GCwkIBwMCBhUIAgkKCwQWAgMBAh4B |
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 random | |
win_on_switch = 0 | |
win_on_stay = 0 | |
for _ in xrange(100000): | |
prize_box = random.randint(0, 2) | |
print "Prize is in box", prize_box | |
initial_choice_box = random.randint(0, 2) | |
print "You choose box", initial_choice_box |