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
This gist is for my post: http://www.andretw.com/2013/07/using-celery-right-now-and-more-best-practices-1.html |
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
This gist is for my post: |
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
This Gist is for my post: http://www.andretw.com/2013/10/What-you-should-know-before-using-DataTables.html |
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
# yum list \*openssl\* | |
yum install -y openssl098e | |
yum install -y zlib | |
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8 | |
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8 | |
ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0 | |
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2 | |
tar -xf pypy-1.8-linux64.tar.bz2 | |
cp -r pypy-1.8 /opt | |
ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin |
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
SomethingCtrl = ($scope, myService) -> | |
$scope.my_array = [] | |
$scope.getList = () -> | |
# do something | |
$scope.my_array = myService.getItems() # return ['a'], ['a', 'b'] or ['a', 'b', 'c'] |
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
# ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
# ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
SELECT CONCAT("ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;") AS alter_sql | |
FROM information_schema.TABLES | |
WHERE TABLE_SCHEMA = 'cms'; |
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 Q | |
tag_list = ['a', 'b', 'c'] | |
q_objects = Q() | |
for t in tag_list: | |
# Use |= for 'or' &= for 'and' | |
q_objects &= Q(blogpost__keyword=t) | |
blog_posts = blog_posts.filter(q_objects) |
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
This Gist is for my post: http://www.andretw.com/2014/04/customize-your-mezzanine-with-Django-middleware-and-JavaScript-AngularJS-for-i18n-multilingual.html |
OlderNewer