Skip to content

Instantly share code, notes, and snippets.

/*
* 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/>.
*/
@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
@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 / 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 / homebrew.mxcl.autossh.plist
Last active December 11, 2022 00:00
launchd plist for Homebrewed autossh (local tunnel)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.autossh</string>
<key>KeepAlive</key>
<true/>
@dpoggi
dpoggi / things.rb
Created September 23, 2015 20:29
Save the first 10,000 objects in Ruby's VM to a text file for inspection
#!/usr/bin/env ruby
things = (0..10000).map do |n|
begin
ObjectSpace._id2ref(n)
rescue
nil
end
end
@dpoggi
dpoggi / astrobuild.go
Last active August 29, 2015 14:17
AstroBuild Go port
package main
import (
"math"
"time"
"fmt"
"os"
)
var planets map[float64][]string

Keybase proof

I hereby claim:

  • I am dpoggi on github.
  • I am danpoggi (https://keybase.io/danpoggi) on keybase.
  • I have a public key ASAv9nfTZHmD7oQOemBCV2Q2_A1aGl8eE96Kb6iy4OK-3Ao

To claim this, I am signing this object:

@dpoggi
dpoggi / .gitignore
Last active August 29, 2015 14:15
Stack Unwinding (thanks HN!)
*.o
*.obj
*.out
unwind
@dpoggi
dpoggi / CD.js
Last active August 29, 2015 14:15
iTunes Playlist -> Ordered Folder Full of WAVs (for burning CDs on another machine)
var options = {
"outputDir": "${HOME}/Downloads",
"numWorkers": 12,
};
var App = Application.currentApplication();
App.includeStandardAdditions = true;
var Finder = Application("Finder");
var iTunes = Application("iTunes");
var Terminal = Application("Terminal");