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
http://trelane.hamtwoslices.net/index.php?random=21915 | |
Ishe. #1 | |
I dunno, less than one, really. #2 | |
12! #3 | |
17 <G> #4 |
#!/usr/bin/env python | |
from __future__ import print_function | |
from sys import stderr | |
from pip import get_installed_distributions | |
from pip.commands import install | |
from pip.exceptions import InstallationError |
<!-- General Settings --> | |
<advancedsettings> | |
<loglevel hide="true">-1</loglevel> <!-- Comment: Disables logging --> | |
<playcountminimumpercent>95</playcountminimumpercent> | |
<skiploopfilter>0</skiploopfilter> <!-- Comment: For RPi or similar use 16 or higher (low CPU usage) --> | |
<nodvdrom>true</nodvdrom> | |
<!-- MySQL Library --> | |
<videodatabase> | |
<type>mysql</type> |
#Prefix is Ctrl-a | |
set -g prefix C-a | |
bind C-a send-prefix | |
unbind C-b | |
set -sg escape-time 1 | |
set -g base-index 1 | |
setw -g pane-base-index 1 | |
#Mouse works as expected |
## A re-spin on http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer, see | |
## http://community.linuxmint.com/tutorial/view/365 | |
## SHARP-BANG NEXT LINE | |
#!/bin/sh | |
# Copyright (c) 2007 Aristotle Pagaltzis | |
# 2013 Sören Andersen | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to |
# | |
# Jekyll Generator for SCSS | |
# | |
# (File paths in this description relative to jekyll project root directory) | |
# Place this file in ./_plugins | |
# Place .scss files in ./_scss | |
# Compiles .scss files in ./_scss to .css files in whatever directory you indicated in your config | |
# Config file placed in ./_sass/config.rb | |
# | |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branch pr/4
from the github upstream
(if it exists) or origin
remote and checks it outgit pr 4 someremote
- creates local branch pr/4
from someremote
remote and checks it out# using libfaac on Mac OS X 10.6.8 | |
# -vn : not copying video | |
# -acodec : specify codec used in flv file | |
# -ac : channels. 1 is for mono, 2 is for stereo | |
# -ab : specify bitrate for output file (note that rate is not kbps but bps) | |
# -ar : sampling frequency (Hz) | |
# -threads: number of threads for encoding | |
# "-strict experimental" is necessary to use libfaac | |
ffmpeg -y -i xxxxxxxxxxx.flv -vn -acodec aac -ac 2 -ab 128000 -ar 44100 -threads 4 -strict experimental xxxxx.m4a |
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |