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
| #define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
| #define UserDefaults [NSUserDefaults standardUserDefaults] | |
| #define NotificationCenter [NSNotificationCenter defaultCenter] | |
| #define SharedApplication [UIApplication sharedApplication] | |
| #define Bundle [NSBundle mainBundle] | |
| #define MainScreen [UIScreen mainScreen] | |
| #define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
| #define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
| #define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
| #define NavBar self.navigationController.navigationBar |
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
| /* | |
| * RIFFWAVE.js v0.03 - Audio encoder for HTML5 <audio> elements. | |
| * Copyleft 2011 by Pedro Ladaria <pedro.ladaria at Gmail dot com> | |
| * | |
| * Public Domain | |
| * | |
| * Changelog: | |
| * | |
| * 0.01 - First release | |
| * 0.02 - New faster base64 encoding |
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
| // directly uploads to S3 | |
| // See http://philfreo.com/blog/how-to-allow-direct-file-uploads-from-javascript-to-amazon-s3-signed-by-python/ | |
| // See https://github.com/elasticsales/s3upload-coffee-javascript | |
| editors.Filepicker = editors.Text.extend({ | |
| tagName: 'div', | |
| events: { | |
| 'change input[type=file]': 'uploadFile', |
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
| Select all and delete (actually move to buffer) | |
| :%d | |
| Select all and copy to buffer | |
| :%y | |
| Use p to paste the buffer. |
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
| import threading | |
| # Based on tornado.ioloop.IOLoop.instance() approach. | |
| # See https://github.com/facebook/tornado | |
| class SingletonMixin(object): | |
| __singleton_lock = threading.Lock() | |
| __singleton_instance = None | |
| @classmethod |
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: utf8 | |
| """ | |
| Securely hash and check passwords using PBKDF2. | |
| Use random salts to protect againt rainbow tables, many iterations against | |
| brute-force, and constant-time comparaison againt timing attacks. | |
| Keep parameters to the algorithm together with the hash so that we can | |
| change the parameters and keep older hashes working. |
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
| #pragma tableview datasource | |
| - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | |
| return 1; | |
| } | |
| - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| return 0; | |
| } | |
| - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
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 { | |
| background-color: #F8F8F8; | |
| font-family: 'Open Sans', sans-serif; | |
| font-size: 14px; | |
| font-weight: normal; | |
| line-height: 1.2em; | |
| margin: 15px; | |
| } | |
| #view-container { |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
| <!-- country codes (ISO 3166) and Dial codes. --> | |
| <select name="countryCode" id=""> | |
| <option data-countryCode="GB" value="44" Selected>UK (+44)</option> | |
| <option data-countryCode="US" value="1">USA (+1)</option> | |
| <optgroup label="Other countries"> | |
| <option data-countryCode="DZ" value="213">Algeria (+213)</option> | |
| <option data-countryCode="AD" value="376">Andorra (+376)</option> | |
| <option data-countryCode="AO" value="244">Angola (+244)</option> | |
| <option data-countryCode="AI" value="1264">Anguilla (+1264)</option> | |
| <option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option> |