Skip to content

Instantly share code, notes, and snippets.

View lorin's full-sized avatar
🤷‍♂️
Nominal

Lorin Hochstein lorin

🤷‍♂️
Nominal
View GitHub Profile
@lorin
lorin / png.js
Last active April 3, 2018 21:03
Convert svg to png with styling using phantomjs
#!/usr/bin/env phantomjs
/*
* Convert svg to png using PhantomJS
*
* Usage: png.js filename.svg filename.png
*
* Asses width and height attributes are present on the svg node
*
*/
var system = require('system');
@lorin
lorin / prepare-commit-msg
Created December 1, 2014 15:38
Prepend JIRA ticket name in commit message
#!/usr/bin/python
"""
This is a prepare-commit-msg hook for use with Jira
Copy this file to $GITREPOSITORY/.git/hooks/prepare-commit-msg
It will prepend PROJ-123 to your commit message, assuming your branch is
named proj-123.
"""
- hosts: localhost
gather_facts: false
tasks:
- local_action:
module: ec2
key_name: key
instance_type: r3.2xlarge
region: us-east-1
image: ami-xxxxxxx
group: somegroup
@lorin
lorin / sockpath.c
Last active July 7, 2016 01:27
Output maximum path length of unix domain socket
#include <sys/un.h>
#include <stdio.h>
int main()
{
struct sockaddr_un s;
printf("%lu\n", sizeof(s.sun_path));
return 0;
}
@lorin
lorin / vagrant.py
Created September 25, 2014 21:25
Vagrant dynamic inventory script for Ansible
#!/usr/bin/env python
# Adapted from Mark Mandel's implementation
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py
import argparse
import json
import paramiko
import subprocess
import sys
@lorin
lorin / icanhazip
Created June 9, 2014 13:54
Ansible module for icanhazip
#!/bin/sh
IP=`curl --silent icanhazip.com`
echo "changed=false ip=$IP"
@lorin
lorin / keybase.md
Created April 9, 2014 00:39
keybase.md

Keybase proof

I hereby claim:

  • I am lorin on github.
  • I am lorin (https://keybase.io/lorin) on keybase.
  • I have a public key whose fingerprint is 4DCD DC44 8576 BDC8 A748 D496 AD39 34D4 CDC9 8E74

To claim this, I am signing this object:

@lorin
lorin / keybase.md
Created April 9, 2014 00:39
keybase.md

Keybase proof

I hereby claim:

  • I am lorin on github.
  • I am lorin (https://keybase.io/lorin) on keybase.
  • I have a public key whose fingerprint is 4DCD DC44 8576 BDC8 A748 D496 AD39 34D4 CDC9 8E74

To claim this, I am signing this object:

<a id="logABugLink" href="">Log a bug</a>
<script language="JavaScript">
var bugTitle = "4.1. Simplicity in Cloud Files™ Introduction - API v1";
var buildTime = "Built 20130918T23 04 24Z05 00"
var docUrl = "at url " + window.location.pathname;
var gitSha = "git SHA a997cbc1" ;
var gitRepo = "git Repo git@github.rackspace.com:IX/cloud-files.git ";
var lineFeed = "%0A";
var fieldComment = encodeURI(buildTime) + lineFeed + encodeURI(gitSha) + lineFeed + encodeURI(docUrl) + lineFeed + encodeURI(gitRepo);
@lorin
lorin / prepare-commit-msg
Created August 29, 2013 03:08
A git hook for annotating a git commit message with info about an associated Trello card.
#!/usr/bin/python
"""
This is a prepare-commit-msg hook for use with git-flow and Trello
Copy this file to $GITREPOSITORY/.git/hooks/prepare-commit-msg
It will prepend [<card id>] to your commit message, and append a
link to the Trello card at the end of the commit message
Assumes you name your feature branches card-id/name.