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",

Keybase proof

I hereby claim:

  • I am cwarden on github.
  • I am cwarden (https://keybase.io/cwarden) on keybase.
  • I have a public key whose fingerprint is CB1F D04D A7F8 4780 4C8D 1CE8 5D22 7839 4EF7 97A0

To claim this, I am signing this object:

@cwarden
cwarden / Toogle New Components
Last active December 22, 2015 04:19
A bookmarklet to toggle between all components and new components in Salesforce's packaging page. Visit http://jsfiddle.net/cwarden/Vzm2s/embedded/result/ for link to drag to bookmark bar.
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="//ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.8.3",function($,L){(function() { if ($('.dataRow:hidden').length) { $('.dataRow').show(); } else { $('.dataRow').hide(); $('.dataRow td:nth-child(7):empty').add('.dataRow td:nth-child(7):contains("N/A")').parent(':has(td:nth-child(8):empty)').show(); }})()});
@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;
$ curl -i -X OPTIONS http://www.woopra.com/rest/search
HTTP/1.0 200 OK
Access-Control-Allow-Headers: Content-Type, X-Api-Version, X-Access-Id, X-Access-Secret
Access-Control-Allow-Origin: *
Date: Mon, 25 Feb 2013 23:59:34 GMT
Content-Length: 0
Access-Control-Allow-Methods: POST, GET, OPTIONS
Content-Type: application/javascript
<?php
function validateSignedRequest($signedRequest, $key) {
list($signature, $payload) = explode('.', $signedRequest);
$hmac = base64_encode(hash_hmac('sha256', $payload, $key, true));
return $signature == $hmac;
}
@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 / gist:3840968
Created October 5, 2012 16:55
Android Tools
# filtering logs
./platform-tools/adb logcat 'dalvikvm:S AmazonEmail:S NotificationService:S IconMerger:S dalvikvm-heap:S v8:S DeviceStorageMonitorService:S'
# dealing with device not found
./platform-tools/adb kill-server
./platform-tools/adb start-server