Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Bartlett jonbartlett

  • Victoria, Australia
View GitHub Profile
@darconeous
darconeous / eagle-200-curl.md
Last active August 10, 2022 03:34
Eagle-200 Local Usage via CURL
View eagle-200-curl.md

Eagle-200 Local Usage via CURL

You can locally pull data from your Rainforest Eagle-200 using cURL.

Rainforest has published a local API document which explains the details of the protocol. But this particular document is about quickly getting to the point and giving you some cURL commands you can use to immediately start pulling out data.

Prerequisites

First, I'll assume that you have the following environment variables set:

View tmux_weather.md

#Adding weather to your tmux status bar.

##Python file that writes the weather to a text file.

#!/Users/jhwhite/anaconda/bin/python
# -*- coding: utf-8 -*-

import forecastio
import math
@pkuczynski
pkuczynski / parse_yaml.sh
Last active March 12, 2023 21:37
Read YAML file from Bash script
View parse_yaml.sh
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@thewtex
thewtex / notify
Created February 17, 2013 02:13
Script to send a tmux, desktop, and audio notification after the completion of the given command when using tmux.
View notify
#!/bin/bash
# Send a tmux, desktop, and audio notification after the completion
# of the given command when using tmux.
#
# Requires: tmux
# Recommended: espeak, libnotify
tmux_window=$(/usr/bin/tmux list-windows \
-F "#{window_active} #{window_index} #{window_name}" | \
@malarkey
malarkey / Contract Killer 3.md
Last active March 25, 2023 04:55
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………