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 | |
| # | |
| # Author: Jacer Omri | |
| # Description: | |
| # text to speech engine using google | |
| ## a function to encode urls | |
| rawurlencode() { | |
| local string="${1}" | |
| local strlen=${#string} |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| #!/usr/bin/python | |
| ''' pms | |
| Copyright (C) 2013 nagev | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| # (c) 2011-2013 Dennis Kaarsemaker <dennis@kaarsemaker.net> | |
| # see COPYING for license details | |
| # Test edit! | |
| import os | |
| import platform | |
| import random | |
| import re | |
| import socket | |
| import subprocess |
| # Released by rdb under the Unlicense (unlicense.org) | |
| # Further reading about the WinMM Joystick API: | |
| # http://msdn.microsoft.com/en-us/library/windows/desktop/dd757116(v=vs.85).aspx | |
| from math import floor, ceil | |
| import time | |
| import ctypes | |
| import _winreg as winreg | |
| from ctypes.wintypes import WORD, UINT, DWORD | |
| from ctypes.wintypes import WCHAR as TCHAR |
| if [ $EUID != 0 ]; then | |
| echo "It's a weird tree." | |
| else | |
| echo ' _ __' | |
| echo ' / `\ (~._ ./ )' | |
| echo ' \__/ __`-_\__/ ./' | |
| echo ' _ \ \/ \ \ |_ __' | |
| echo ' ( ) \__/ -^ \ / \' | |
| echo ' \_/ " \ | o o |.. / __' | |
| echo " \\. --' ==== / || / \\ " |
| #!/usr/bin/python3 | |
| from collections import deque | |
| from time import sleep | |
| from os import system | |
| def tilt(): | |
| with open('/sys/devices/platform/lis3lv02d/position') as f: | |
| return int(f.read().split(",")[1]) |
| <?xml version="1.0"?> | |
| <!-- | |
| use "man thermal-conf.xml" for details | |
| --> | |
| <!-- BEGIN --> | |
| <ThermalConfiguration> | |
| <Platform> | |
| <Name>Lenovo ThinkPad X220</Name> | |
| <ProductName>*</ProductName> | |
| <Preference>QUIET</Preference> |