Skip to content

Instantly share code, notes, and snippets.

@dpoggi
dpoggi / rtctl
Last active June 24, 2016 11:36
rtorrent ctl script
#!/usr/bin/env bash
c_reset="\033[0m"
c_date="\033[0;37m"
c_fatal="\033[1;37;41m"
log_msg() {
printf >&2 "${c_date}[%s]:${c_reset} " "$(date +"%H:%M:%S")"
if [[ "$1" = "-n" ]]; then
printf >&2 "$2"
@dpoggi
dpoggi / imgcat.rb
Last active April 12, 2016 20:59
Homebrew formula for imgcat (modified from closed PR on Homebrew/Homebrew)
class Imgcat < Formula
desc "imgcat for iTerm"
homepage "https://www.iterm2.com/images.html"
version "2.9.20160313"
url "https://raw.githubusercontent.com/gnachman/iTerm2/v#{version}/tests/imgcat"
sha256 "036ee8aec2487a02b40d62d72918090ae022fc018589337dfd8403e08ffdd0c0"
head do
url "https://raw.githubusercontent.com/gnachman/iTerm2/HEAD/tests/imgcat"
end
@dpoggi
dpoggi / HypermediaResources.java
Last active September 4, 2017 02:17
Helper class template for Spring HATEOAS in plain Java 6 and Kotlin (Apache 2.0 License)
/*
* Copyright 2017 Dan Poggi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* midwestern.hpp by Dan Poggi
*
* To the extent possible under law, the person who associated CC0 with
* midwestern.hpp has waived all copyright and related or neighboring
* rights to midwestern.hpp.
*
* You should have received a copy of the CC0 legalcode along with this
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/