Skip to content

Instantly share code, notes, and snippets.

View cwarden's full-sized avatar

Christian G. Warden cwarden

View GitHub Profile
@cwarden
cwarden / taxes.smt2
Created September 19, 2022 12:41 — forked from lynaghk/taxes.smt2
S-Corp tax optimization with the Z3 Theorem Prover
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Solo freelancer's S-Corp tax optimization
;;
;; Assumes an unmarried single-shareholder and tons of other stuff.
;; I'm not a tax professional, no guarantees here, probably typos, etc. Come on!
;; Run with https://github.com/Z3Prover/z3
;;
;; See also my notes at https://kevinlynagh.com/financial-plan/
@cwarden
cwarden / NPI Importer.go
Created September 13, 2017 16:44 — forked from ewhitebloom/NPI Importer.go
ETL NPI data from NPI CSV file to MySQL.
package main
import (
"bufio"
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"os"
"reflect"
"strconv"
@cwarden
cwarden / config.json
Last active February 16, 2016 04:13 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@cwarden
cwarden / debounce.js
Last active December 19, 2015 23:29 — forked from swannodette/debounce.clj
/* Takes a function that optionally returns a promise, and debounces it, returning a
* promise to all callers. When the debounced function fulfills its promise or
* returns a non-promise, all callers get the result.
* Example: http://bit.ly/1btZC4f
*/
var debounce = function(func, wait, immediate) {
var timeout;
var deferred = $.Deferred();
return function() {
var context = this, args = arguments;
@cwarden
cwarden / emoji_sad.txt
Created November 27, 2012 00:56 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@cwarden
cwarden / table.html
Created July 11, 2012 15:27 — forked from dunhamsteve/table.html
Example of a scrollable table that only renders visible rows
<html>
<style type="text/css" media="screen">
#table {
position: absolute;
top: 30px;
bottom: 0;
left: 10px;
right: 10px;
}
#header {
@cwarden
cwarden / sc-dl.js
Created March 6, 2012 16:08
Bookmarklet that generates download link for a Soundcloud upload
(function(b) {
var a = b.createElement("a");
var s = b.createElement("span");
s.innerText = "Download";
a.appendChild(s);
a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1];
a.setAttribute("class", "pl-button");
a.setAttribute("style", "background-image: url(http://soundcloud.com/images/icons_mini.png?unicorn26); background-repeat: no-repeat; padding-left: 18px; background-position: -77px -236px;");
a.download = b.querySelector("em").innerText+".mp3";
b.querySelector(".primary").appendChild(a);
@cwarden
cwarden / gist:1705587
Created January 30, 2012 17:37 — forked from jedi4ever/gist:1704761
Puppet puzzle : parametrized classes - common logic
#First class = role web (calls logstash::common to setup directory structure)
class logstash::web(
$version = '1.1.0beta8'
) {
if !defined(Class['logstash::common']) {
class {'logstash::common':
version => $version
}
}
}
@cwarden
cwarden / INSTALL
Created September 2, 2011 01:01 — forked from mat/INSTALL
Turn an Ubuntu 10.04 server into a StatsD/Graphite server
TODO:
- edit /opt/statsd/local.js
- correct the graphite host to localhost
- if desired, put 'debug: true' in there
- make the box accessible via the hostname 'graphite'
- patch graphite, like described in https://answers.launchpad.net/graphite/+question/152851
@cwarden
cwarden / statsd.lua
Created September 1, 2011 22:05 — forked from jbarciauskas/StatsD.php
Lua client for StatsD
-- StatsD.php ported to lua
local math = require "math"
local os = require "os"
local socket = require "socket"
local type, pairs, ipairs, next = type, pairs, ipairs, next
local pcall = pcall
math.randomseed(os.time())