Skip to content

Instantly share code, notes, and snippets.

View redSlug's full-sized avatar

Bradley Dettmer redSlug

  • New York, New York
View GitHub Profile
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token…
### Keybase proof
I hereby claim:
* I am redslug on github.
* I am bdettmer (https://keybase.io/bdettmer) on keybase.
* I have a public key ASCp6fBbSlLQuPSi9pc9eLH2M3nlaPhD3OkRTyEMJUif7Qo
To claim this, I am signing this object:
------------------------------- MODULE fun -------------------------------
EXTENDS Naturals, TLC
(* --algorithm transfer
variables alice_account = 10, bob_account = 10, account_total = alice_account + bob_account, is_transferring = FALSE;
process Transfer \in 1..2
variable money \in 1..20;
begin
@redSlug
redSlug / transfer.tla
Created April 24, 2018 20:13
pluscal code
(* --algorithm transfer
variables alice_account = 10, bob_account = 10, account_total = alice_account + bob_account, is_transferring = FALSE;
process Transfer \in 1..2
variable money \in 1..20;
begin
Transfer:
if is_transferring = FALSE then
Lock: is_transferring := TRUE;
@redSlug
redSlug / hello.tla
Created April 23, 2018 16:41
down on our lock
------------------------------- MODULE hello -------------------------------
EXTENDS Naturals, TLC
(* --algorithm transfer
variables alice_account = 10, bob_account = 10, account_total = alice_account + bob_account, is_transferring = FALSE;
process Transfer \in 1..2
variable money \in 1..20;
begin
#!/bin/bash
pushd /home/pi/weather
source ~/.SECRET
source venv/bin/activate
python get_weather.py $DARK_SKI_API_KEY
date >> log
popd
DARK_SKI_API_KEY=blah
summary = '{}-{}F '.format(int(tempLow), int(tempHigh)) + summary
font_size_in_points = 9
font = ImageFont.truetype('fonts/led.ttf', font_size_in_points)
font_size = font.getsize(summary)
print('summary: {}, font size: {}'.format(summary, font_size))
summary_img = Image.new('RGB', font_size)
draw = ImageDraw.Draw(summary_img)
draw.text((0, 0), summary, font=font)
#!/bin/bash
cleanup() {
echo "Cleaning stuff up" >> log
sudo pkill demo
popd
exit
}
pushd /home/pi/weather
*/2 * * * * /home/pi/weather/get_weather.sh >> ~/weather/log
@reboot /home/pi/weather/show_weather.sh >> ~/weather/log