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
Host github.com | |
User git | |
Hostname github.com | |
PreferredAuthentications publickey | |
IdentityFile /home/user/.ssh/id_rsa |
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
# --no-check-cerftificate was necessary for me to have wget not puke about https | |
curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
<?php | |
/** | |
* Compare two arrays and return a list of items only in array1 (deletions) and only in array2 (insertions) | |
* | |
* @param array $array1 The 'original' array, for comparison. Items that exist here only are considered to be deleted (deletions). | |
* @param array $array2 The 'new' array. Items that exist here only are considered to be new items (insertions). | |
* @param array $keysToCompare A list of array key names that should be used for comparison of arrays (ignore all other keys) | |
* @return array[] array with keys 'insertions' and 'deletions' | |
*/ | |
public static function arrayDifference(array $array1, array $array2, array $keysToCompare = null) { |
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
import Tkinter | |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
from matplotlib.figure import Figure | |
class App: | |
def __init__(self, master): | |
# Create a container | |
frame = Tkinter.Frame(master) | |
# Create 2 buttons | |
self.button_left = Tkinter.Button(frame,text="< Decrease Slope", |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
<?php | |
/** | |
* Based on http://www.wenigersh.com/blog/post/maintenance-mode-for-symfony-2-applications | |
* | |
* Includes support of user permisson check (here: check if user has role ADMIN), so admins can still surf the site while in maintenance mode | |
* Be aware that if you clear the cache (to start maintenance in prod environment) your sessions might be cleared as well, so people get logged out | |
* The config.yml will move the sessions to /app/sessions/[environment] | |
* | |
* Also be aware that you need at least Symfony 2.6 for this permission check. For older versions the call is different | |
* @see http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements |