Skip to content

Instantly share code, notes, and snippets.


Jeremiah Roth rothwerx

View GitHub Profile
rothwerx / gist:6128390
Created Aug 1, 2013
PHP: Custom Drupal (5) module for Bronto email APIv4. Only putting it here because the internet lacks good examples of the Bronto API. Add error handling as needed.
View gist:6128390
function bronto_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/mymodule/settings/bronto',
'access' => user_access('administer site configuration'),
'title' => t('Bronto settings'),
rothwerx / gist:6499935
Created Sep 9, 2013
Bash: Deal with it
View gist:6499935
function dealwithit() {
echo "( °_°)"
sleep 1
tput cuu1
tput el
echo "( °_°)‿‑●‑●"
sleep 2
tput cuu1
tput el
echo "(‑●‑●)>"
rothwerx / gist:6574543
Last active Dec 23, 2015
Bash: Animated dance. Useful for your celebrating when your multi-pipe one-liner works on the first try.
View gist:6574543
function _totheleft() {
echo "(°_°)"
echo "<) )╯"
echo ' / \'
function _totheright() {
echo " (°_°)"
echo "\( (>"
echo ' / \'
rothwerx / gist:7146476
Created Oct 24, 2013
Go: Small example of running system commands
View gist:7146476
package main
import "os/exec"
import "fmt"
import "bytes"
func main() {
cmd := exec.Command("/bin/ls", "-al")
var out bytes.Buffer
cmd.Stdout = &out
rothwerx / gist:10440939
Created Apr 11, 2014
Python: Raspberry Pi: Read photocell values and graph with Graphite. I used this with cron for determining the best place to grow tomatoes.
View gist:10440939
!/usr/bin/env python
import RPi.GPIO as GPIO
import datetime
import socket
import time
import os
metric_path = "sun.loc1"
View gist:d206b61f91526742e5e7
set nocompatible
if has("syntax")
syntax on
if has("autocmd")
" Automatically reload vimrc after saving
autocmd bufwritepost .vimrc source $MYVIMRC
" Remember last position in file
rothwerx / gist:3392745ab7bef150a73a
Created Dec 9, 2014
ISC DHCP configuration that updates Windows DDNS
View gist:3392745ab7bef150a73a
option domain-name "";
option domain-search "";
option domain-name-servers,,,;
ddns-updates on;
ddns-update-style interim;
update-static-leases on;
rothwerx / gist:c894bd8b08fee8ab1a53
Created Dec 14, 2014
Get the install date of a linux system
View gist:c894bd8b08fee8ab1a53
tune2fs -l /dev/sda1 | awk -F" +" '/Filesystem created/ { print $2 }'
View gist:4bfc8ce77c23e788d4a0
# This file can be wget'ed at
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
if ! command -v git; then
echo "You really need git."
exit 1
View gist:700f275d078b3483509f
// These were written specifically for the Adafruit 8x8 LED matrix,
// but they could be used anywhere you need
// 64 bit character representations. I wasn't happy with any of the characters I
// found, so I created these. They're nice and bold, not silly line letters.
B00110000,B01111000,B11001100,B11001100,B11111100,B11001100,B11001100,B00000000,25, // A
B11111100,B01100110,B01100110,B01111100,B01100110,B01100110,B11111100,B00000000,25, // B
B00111100,B01100110,B11000000,B11000000,B11000000,B01100110,B00111100,B00000000,25, // C
B11111000,B01101100,B01100110,B01100110,B01100110,B01101100,B11111000,B00000000,25, // D
B11111110,B01100010,B01101000,B01111000,B01101000,B01100010,B11111110,B00000000,25, // E
You can’t perform that action at this time.