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 | |
SEC=0 # in seconds | |
MIN=0 # in minutes | |
while !(ping -c1 google.com > /dev/null 2>&1); do | |
echo $SEC | |
let SEC=SEC+1 | |
sleep 1 | |
done | |
let MIN=SEC/60 | |
let SEC=SEC-MIN*60 |
<link rel="import" href="../core-pages/core-pages.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
import twitter4j.*; | |
import twitter4j.conf.ConfigurationBuilder; | |
public class TwitterBot { | |
private final static int TWEETS_IN_PAGE = 100; | |
public static void main(String[] args) { | |
//Read the twitter4j.properties | |
ConfigurationBuilder cb = new ConfigurationBuilder(); | |
try { |
<!doctype html> | |
<html> | |
<head> | |
<title>Site Maintenance</title> | |
<meta charset="utf-8"/> | |
<meta name="robots" content="noindex"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } |
# ^--^ ^------------^ | |
# | +-> Summary in present tense. | |
# +-------> Type: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, or test | |
# ✨ feat: new feature for the user, not a new feature for build script | |
# 🐛 fix: a bug fix or 💥 crash fix or 🚱 memory leak | |
# 📚 docs: 📝 changes to the documentation only | |
# 💎 style: 👕 formatting, white-space, etc; no production code change | |
# 🔨 refactor: 👌 code change that does not fix a bug or add a feature, eg. renaming a variable | |
# 🚀 perf: 🐎 code change that improves performance | |
# 🚨 test: ✅ adding missing tests, refactoring tests; no production code change |
I hereby claim:
To claim this, I am signing this object:
Feature: bank account | |
A user's bank account must be able to withdraw and deposit cash | |
Moreover, as the user is rich, with a very large estate, and a lot of vast networking, | |
The bank tolerates having an overdrawn account, thank to expensive overdraft charges | |
Scenario Outline: Deposit | |
Given I have a bank account with <start>$ | |
When I deposit <deposit>$ | |
Then it should have a balance of <end>$ | |
#!/bin/bash | |
#Date uploaded 4/30/2013, 2:21 PM | |
#Henrique CTRL+L (clear), cd - (prev) | |
#David CTRL+R (reverse search), CTRL+G (clear the search) | |
#http://en.kioskea.net/faq/1757-how-to-read-a-file-line-by-line | |
old_IFS=$IFS # save the field separator | |
IFS=$'\n' # new field separator, the end of line |
# Advent of Code template by @MathisHammel | |
# TODO | |
# - Make a snapshot of the file when a submission is correct | |
# - Display the rank when submission is accepted | |
# - Utility function to rotate/flip a 2D array | |
# - Cycle length detector/extrapolator to make loops faster | |
# - Put examples in cache | |
# - Warning if DAY is not the current day |