References:
import datetime | |
import calendar | |
def get_month_day_range(date): | |
""" | |
For a date 'date' returns the start and end date for the month of 'date'. | |
Month with 31 days: | |
>>> date = datetime.date(2011, 7, 27) | |
>>> get_month_day_range(date) |
""" | |
Some Python code to tinker with the ideas presented | |
in the Numberphile episode "How to Win a Guessing Game". | |
See: https://www.youtube.com/watch?v=ud_frfkt1t0 | |
""" | |
import random | |
import time | |
I hereby claim:
- I am tcg on github.
- I am tommygeorge (https://keybase.io/tommygeorge) on keybase.
- I have a public key whose fingerprint is 4EB6 B9FC CF65 5C61 EBEA 8F22 5246 02EA E3D7 FF6B
To claim this, I am signing this object:
# List Git branches in order of most-recently-updated. | |
alias gitbranchesbydate="git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:iso8601) %09 %(refname) %09 %(authorname)' | sed -e 's-refs/heads/--'" | |
# Output looks like: | |
# 2014-06-06 12:58:53 -0500 tcg/donate_language_updates Tommy George | |
# 2014-06-06 10:28:04 -0500 integration Brad | |
# 2014-06-05 16:13:30 -0500 super_dev_branch Chris |
I wanted this capability for various reasons. It's not necessarily stable, because uap0 has to use the same channel as wlan0, and if you're traveling/mobile, wifi channels aren't necessarily predictable.
This is not a guide. This is just so I remember how to get back where I started, in case I wipe this thing. =)
Extremely helpful guides that got me here:
I use a "gaming mouse" as my current favorite every-day computer mouse, when I'm not just using the trackpad.
If you're not familiar with it, it's a great computer mouse that has some extra buttons that can be arbitrarily assigned key combos, macros, and various functions.
Recently, I decided to tweak some settings for every day desktop/work use, and I've been quite pleased. Here's a couple things I did:
/** | |
* This gulpfile inspired by http://danbahrami.io/articles/building-a-production-website-with-hugo-and-gulp-js/ | |
* | |
* Tasks for building sass/scss, and hashed assets, in combination with the | |
* hugo generated blog. | |
* | |
*/ | |
var gulp = require("gulp"), | |
sass = require("gulp-sass"), |
def _dates_for_year(year): | |
""" | |
A generator of all `datetime.date`s for a given integer year. | |
""" | |
if year != int(year): | |
raise ValueError(f"Year provided does not appear to be an integer. Provided: {year}") | |
for month in range(1, 12 + 1): | |
# Leaning on the calendar module to give the correct number of | |
# days for leap year February. |