Skip to content

Instantly share code, notes, and snippets.

View josh-padnick's full-sized avatar

Josh Padnick josh-padnick

View GitHub Profile
@josh-padnick
josh-padnick / computeEGA
Created March 25, 2014 18:03
Compute Estimated Gestational Age from Due Date (Javascript)
// Usage: computeEGA(2014, 4, 14);
// Computes the Estimated Gestational Age of a patient based on today's date and her Expected Due Date (EDD)
// Sample data
var iDueDateYear = 2014;
var iDueDateMonth = 4;
var iDueDateDay = 14;
function computeEGA( iDueDateYear, iDueDateMonth, iDueDateDay ) {
var dToday = new Date();
@josh-padnick
josh-padnick / MyController.java
Created July 18, 2014 03:36
Ugly Sample of JDBC Promises in Play (probably with anti-patterns)
public void sendTextMessage() throws SQLException {
// Open a connection
CustomConnectionMgr.openConnection();
// Tell the connection object to start a transaction
CustomConnectionMgr.startTransaction();
F.Promise<Integer> notifyBatchIdPromise;
F.Promise<Integer> notifyConversationIdPromise;
@josh-padnick
josh-padnick / minion
Created January 21, 2015 19:13
Masterless Salt Minion
file_client: local
file_roots:
base:
- /srv/salt/base
@josh-padnick
josh-padnick / rsync.sh
Created March 4, 2015 16:48
Using Rsync to Sync a Directory to a Remote Instance
rsync -ra --out-format='[%t]--%n' --delete /path/to/local/folder/ <SSH-USER>@<SERVER-IP-ADDRESS>:/path/to/remote/folder
@josh-padnick
josh-padnick / install-go-cross-compile.sh
Last active August 29, 2015 14:22
Install Latest Golang
#!/bin/bash
# Install goxc
go get github.com/laher/goxc
# May need to do these commands...
goxc -t
# Build the binaries
`GOOS=darwin GOARCH=386 go build -o /home/ubuntu/builds/ec2-snapper/0.1.0/darwin_386/ec2-snapper`
@josh-padnick
josh-padnick / gist:1b951f7b089a33ad3bce
Created November 12, 2015 22:48
Sample CircleCI API Output
// Hello human (for machine readable JSON, use the "application/json" Accept header)
{
"compare" : "https://github.com/PhoenixDevOps/phxjug-play-framework-demo/compare/be242da2963b...8f39e4044911",
"previous_successful_build" : {
"build_num" : 22,
"status" : "success",
"build_time_millis" : 796881
},
"build_parameters" : null,
{
"homepage" : "http://infusionsoft.com"
}

Keybase proof

I hereby claim:

  • I am josh-padnick on github.
  • I am ohmygoshjosh (https://keybase.io/ohmygoshjosh) on keybase.
  • I have a public key ASCbtKTyzn5uSF7Jp_xL6uF1SUxIqlexOpnujOuZPGVMJQo

To claim this, I am signing this object:

@josh-padnick
josh-padnick / go-test.sh
Created April 1, 2016 23:18
go test all but vendor directory
go test $(go list ./... | grep -v /vendor/)
@josh-padnick
josh-padnick / terraform_debug_log.txt
Created September 18, 2016 19:15
Terraform Debug Log
2016/09/18 12:14:29 [INFO] Terraform version: 0.7.3 0dd7c657d6d60d2e7392b66ae6f74fb84582cab9
2016/09/18 12:14:29 [INFO] CLI args: []string{"/opt/lib/terraform/terraform", "apply"}
2016/09/18 12:14:29 [DEBUG] Detected home directory from env var: /Users/josh
2016/09/18 12:14:29 [DEBUG] Detected home directory from env var: /Users/josh
2016/09/18 12:14:29 [DEBUG] Attempting to open CLI config file: /Users/josh/.terraformrc
2016/09/18 12:14:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/09/18 12:14:29 [DEBUG] Detected home directory from env var: /Users/josh
2016/09/18 12:14:30 [WARN] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2016/09/18 12:14:30 [DEBUG] DestroyEdgeInclude: Checking: data.template_file.s3_bucket_policy
2016/09/18 12:14:30 [DEBUG] DestroyEdgeInclude: Checking: aws_s3_bucket.webform