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
| #!/bin/bash | |
| # GTK+ and Firefox for Amazon Linux | |
| # Written by Joseph Lawson 2012-06-03 | |
| # http://joekiller.com | |
| # http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/ | |
| # chmod 755 ./gtk-firefox.sh | |
| # sudo ./gtk-firefox.sh | |
| // download soundManager2 and refer it in your scripts http://www.schillmania.com/projects/soundmanager2/doc/download/#latest | |
| // also add the swf directory to your project | |
| // your module declaration | |
| var app = angular.module('myApp', []); | |
| // attach the soundManager global for AngularJS dependency injection | |
| app.value('soundManager', soundManager); | |
| // usage |
| import datetime | |
| import time | |
| from functools import wraps | |
| from wsgiref.handlers import format_date_time | |
| from flask import make_response | |
| def cache(expires=None, round_to_minute=False): | |
| """ | |
| Add Flask cache response headers based on expires in seconds. |
| var Headout = { | |
| apply: function() { | |
| return true; | |
| }, | |
| code: function() { | |
| console.log("I", this.a.join(' '), 'code at Headout'); | |
| this.a = []; | |
| return this; | |
| }, | |
| a: [] |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "443" | |
| } |
| # In big teams instead of specifying one email to rule them all as apple_id | |
| # You can get this information from environment variable | |
| # By doing this it will allow different developers to specify their own apple ids | |
| # And if this env variable is not required - then it will be asked on any command that requires apple_id | |
| apple_id ENV["MY_APP_NAME_APPLE_ID"] # Your Apple email address | |
| ### ~/.bashrc of some user | |
| export MY_APP_NAME_APPLE_ID="someuser@gmail.com" | |
| #!/usr/bin/env python | |
| # Source: http://code.activestate.com/recipes/325905-memoize-decorator-with-timeout/#c1 | |
| import time | |
| from functools import wraps | |
| class MWT: | |
| """Memoize With Timeout""" | |
| _caches = {} | |
| _timeouts = {} |