A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| @interface PSPDFThreadSafeMutableDictionary : NSMutableDictionary | |
| @end | |
| #import "PSPDFThreadSafeMutableDictionary.h" | |
| #import <libkern/OSAtomic.h> | |
| @implementation PSPDFThreadSafeMutableDictionary { | |
| OSSpinLock _lock; | |
| NSMutableDictionary *_dictionary; // Class Cluster! |
##Chai Expect
##Language Chains
| // Defines a yet undocumented method to add a warning if super isn't called. | |
| #ifndef NS_REQUIRES_SUPER | |
| #if __has_attribute(objc_requires_super) | |
| #define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
| #else | |
| #define NS_REQUIRES_SUPER | |
| #endif | |
| #endif |
| // | |
| // StickyHeaderLayout.h | |
| // Wombat | |
| // | |
| // Created by Todd Laney on 1/9/13. | |
| // Copyright (c) 2013 ToddLa. All rights reserved. | |
| // | |
| // Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS! | |
| // |
by Asim Jalis, MetaProse.com
Create a file __main__.py containing:
print "Hello world from Python"
Zip up the Python files (in this case just this one file) into app.zip by typing:
| #!/bin/bash | |
| # setup | |
| FILES=name_of_file_to_match_*.mp4 | |
| SEEK_POINT=00:00:30 | |
| IMG_FORMAT=png | |
| FRAME_SIZE=150X100 | |
| DEST=thumbnails | |
| for f in $FILES |
| <?php | |
| $mongodb = new Mongo("mongodb://username:password@localhost/database_name"); | |
| $database = $mongodb->database_name; | |
| $collection = $database->collection; | |
| $page = isset($_GET['page']) ? (int) $_GET['page'] : 1; | |
| $limit = 12; | |
| $skip = ($page - 1) * $limit; | |
| $next = ($page + 1); | |
| $prev = ($page - 1); |
| A warning occurred (42 apples) | |
| An error occurred |
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |