Skip to content

Instantly share code, notes, and snippets.

@dmerand
dmerand / dns-monitor-cron.sh
Created January 28, 2020 02:19
Sample DNS-Monitor CRON Script
#!/usr/bin/env sh
HERE="/Users/explo/cron/dns-monitor-data"
GCHAT_URL='https://gchat_url_goes_here.com'
MANDRILL_KEY='paste_ye_olde_key_here'
MANDRILL_EMAIL="[email protected]"
cd "${HERE}" && /Users/explo/.rbenv/shims/dns-monitor --check \
--domains_path "${HERE}/hosts.txt" \
--db_path "${HERE}/dns-monitor.sqlite3" \
@dmerand
dmerand / keybase.md
Created August 17, 2019 14:02
Keybase Auth

Keybase proof

I hereby claim:

  • I am dmerand on github.
  • I am donaldmerand (https://keybase.io/donaldmerand) on keybase.
  • I have a public key whose fingerprint is 78D3 1A32 50CC 3479 1DA5 365E 3C62 4C48 9615 08BB

To claim this, I am signing this object:

@dmerand
dmerand / filemaker_launcher.sh
Last active April 21, 2017 23:59
Shell Script FileMaker DB Launcher
#!/usr/bin/env sh
# FileMaker Script Launcher
# =========================
#
# **Author:** Donald L. Merand
#
# General template to run ANY FileMaker script.
# NOTE: This is probably Mac-only. I haven't tested it on other platforms.
@dmerand
dmerand / gcode_pause.sh
Last active June 19, 2016 21:41
Insert a pause into a GCODE <<file>> at <<layer number>>, matching layers against an optional <<regex>>
#!/usr/bin/env sh
#---------------------------------------------------------#
# gcode_pause
# Donald L. Merand
# ----------------
# Given (1) a file, (2) a layer number, and an optional
# (3) regular expression matching layer change, add a
# pause command (defaults to "M226" but changeable) to
# the GCODE.
#---------------------------------------------------------#
@dmerand
dmerand / emoticonify
Created January 22, 2015 01:21
HipChat Emoticonify
#!/usr/bin/env sh
#---------------------------------------------------------#
# emoticonify
# Donald L. Merand
# ----------------
# Convert any image file into a suitable hipchat emoticon
#---------------------------------------------------------#
# Usage: emoticonify <file>
# will return <file_emoticon.png>
#---------------------------------------------------------#
@dmerand
dmerand / atom-style.css
Last active August 29, 2015 14:11
Stylesheet Changes to Atom to Center Text
// always center the scroll view
atom-text-editor {
.gutter {
-webkit-flex: 1;
text-align: right;
.line-number {
width: 100%;
}
}
@dmerand
dmerand / random-giphy-bg.html
Last active March 31, 2021 03:05
HTML Template for Random Animated Gif Background Using Giphy
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
$(function() {
var xhr = $.get("http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC");
xhr.done(function(data) {
$('.gif-bg').css('background-image', 'url(' + data.data.image_url + ')');
});
@dmerand
dmerand / tsv2html.sh
Created May 2, 2012 14:56
Convert TSV file to HTML snippet
#!/bin/sh
#convert a TSV file to an HTML file
#author: Donald L. Merand
#note: this is most useful in conjunction with bcat, which sends results to the browser
# you can get bcat on OS X using homebrew
# http://mxcl.github.com/homebrew/
# then type "brew install bcat"
#also note: this script only creates an HTML snippet - you'll probably want to wrap
@dmerand
dmerand / tsvfmt.sh
Created May 2, 2012 14:54
Format TSV files on the command line
#!/bin/sh
#tsvfmt - TSV Formatter
#Author: Donald L. Merand
#----------
#Takes a TSV file, and outputs a text-only representation of the table,
#+ justified to the max width of each column. Basically, you use it when
#+ you want to "preview" a TSV file, or print it prettily.
#----------
#Accepts standard input, or piped/redirected files
#----------
@dmerand
dmerand / imagecomp.sh
Created April 25, 2012 15:32
ImageMagick Image Merger
#!/bin/sh
# IMAGE COMPOSITOR
# Author: Donald L. Merand
# Description: Merge images in a directory together into one composite image.
# Be careful, this program is recursive and can eat up some disk space
# creating images in subdirectories.
# default program options
RESULTSDIR="_results"