This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Adapted for CHIP Computer and Python3 from Limor "Ladyada" Fried for Adafruit Industries, (c) 2015 | |
# This code is released into the public domain | |
import time | |
import os | |
import CHIP_IO.GPIO as GPIO | |
DEBUG = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## A pomodoro timer that dims the screen for resting periods ## | |
# Variables and constants | |
working=25 # Minutes until next break | |
resting=5 # Minutes of rest | |
RED='\033[0;31m' | |
NOC='\033[0m' | |
# First check if the brightness command is installed or else abort script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
(set -x; brew update;) | |
(set -x; brew cask update;) | |
(set -x; brew upgrade;) | |
(set -x; brew cleanup;) | |
(set -x; brew cask cleanup;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn coverage-in-n-samples [samples size population] | |
"Question: How many elements of a population do I get with n samples of size s?" | |
(let [pop (range 0 population)] | |
(->> (range 0 samples) | |
(map (fn [dumb] (take size (shuffle pop)))) | |
(doall) | |
(flatten) | |
(distinct) | |
(count) | |
(* (/ 1.0 population))))) |