This file contains 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
fn main() { | |
let height: [i8; 12] = [0,1,0,2,1,0,1,3,2,1,2,1]; | |
let len = height.len(); | |
let mut left_highest: i8; | |
let mut right_highest: i8; | |
let mut sum_ground: i8 = 0; | |
let mut sum_gwater: i8 = 0; | |
let mut gwater_here: i8; | |
let mut left_i: usize; | |
let mut right_i: usize; |
This file contains 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
>>> def spengbob(s): | |
... return "".join([c.lower() if i % 2 == 0 else c.upper() for i, c in enumerate(s)]) | |
... | |
>>> spengbob("massachusetts") | |
'mAsSaChUsEtTs' |
This file contains 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
#!/bin/bash | |
# Shame people using too much disk. Good for your /etc/update-motd.d | |
# Lol what is this the 90s? | |
PCENT=$(df --output=pcent /home | tr -dc '0-9') | |
if (( $PCENT > 90 )); then | |
echo -e "\033[5mDisk usage has exceeded 90%\033[0m" | |
df -h /home | |
fi |
This file contains 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
import ephem | |
import datetime | |
# ephem.localtime(ephem.next_summer_solstice('2019-1-1')) | |
s = ephem.Sun() | |
o = ephem.city('Boston') | |
yesterday_len = 0 | |
for i in range(0, 365): | |
d = datetime.datetime(2019,1,1,16,0) + datetime.timedelta(i) |
This file contains 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
import csv | |
import pprint | |
with open('salesdata.csv', 'r') as f: | |
cars = [{k: v for k, v in row.items()} for row in csv.DictReader(f, skipinitialspace=True)] | |
fords = filter(lambda x: x['Make'] == 'FORD', cars) | |
v8 = filter(lambda x: '5.8' in x['Engine'], fords) | |
zips = open('zips.txt', 'r').read().strip().split(',') | |
local = filter(lambda x: x['Location ZIP'] in zips, v8) | |
if local: | |
pprint.pprint(local) |
This file contains 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
# 'notify-host-by-email' command definition | |
define command{ | |
command_name notify-host-by-email | |
command_line aws ses send-email --from [email protected] --to $CONTACTEMAIL$ --text "***** dev1 Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$" --subject "dev1 $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$" --region us-west-2 | |
} | |
# 'notify-service-by-email' command definition | |
define command{ | |
command_name notify-service-by-email | |
command_line aws ses send-email --from [email protected] --to $CONTACTEMAIL$ --text "***** dev1 Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Service: $SERVICEDESC$ Host: $HOSTALIAS$ Address: $HOSTADDRESS$ State: $SERVICESTATE$ Date/Time: $LONGDATETIME$ Additional Info: $SERVICEOUTPUT$" --subject "dev1 $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" --region us-west-2 |
This file contains 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 python | |
""" | |
pq. its like jq, you know, but for python. | |
caution: super hackey. | |
""" | |
import json | |
import sys | |
import atexit |
This file contains 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
Why must you tempt me with that image. You can't buy the Trackman Marble FX any more. Not for atleast 8 years. It fetches a handsome price on eBay as well. This was the apex of trackball input devices. What I wouldn't give to have one of these today. The Trackman Marble I use now is very nice but its not as perfectly sculpted as the FX. Maybe 3d printing can bring this masterpiece back to us. | |
In other "i am super persnickety about my input peripherals" news: the new elongated nubbules on the bottom of the Dual Shock 4 controller dig into my palms and cause crazy amounts of fatigue-- something I never experienced with the same button layout but with a Dual Shock 3 controller with much smaller protuberances. |
This file contains 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
# Ubuntu Server Quick Install | |
# Based on http://bit.ly/uquick-doc by Dustin Kirkland <[email protected]> | |
# Boot via DHCP, seriously wipe the disk DO IT | |
# Add boot options: priority=critical locale=en_US url=https://gist.github.com/craigcalef/8201088/raw | |
# | |
d-i debian-installer/locale string en_US.UTF-8 | |
d-i debian-installer/splash boolean false | |
d-i console-setup/ask_detect boolean false | |
d-i console-setup/layoutcode string us |
This file contains 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
November 19, 2013 | |
My deepest sympathies to you and yours. Sending all of my love and strength. | |
~ Kelly Smith Kilmer, Los Angeles, California | |
Contact Me | |
November 19, 2013 | |
Jenn and Brian we are so sorry for you loss. May all your memories comfort you. We love you and are here if you need us | |
~ Deb Rob and Liam Ahern, Pascoag, Rhode Island | |
November 18, 2013 | |
RIP uncle John! I'm so sorry I didn't see you first. Thanks for always being so good to us kids. Love you forever! | |
~ Cameron Calef, Quincy, Massachusetts |
NewerOlder