Skip to content

Instantly share code, notes, and snippets.

@mattfinlayson
mattfinlayson / config.yaml
Created December 10, 2013 23:02
Little ruby script to take the results of a jql query (advanced search) in jira and create todo item's for Cultured Code's Things App. I use it at the beginning of a sprint to keep track of my own work and progress. If I get less lazy I could always sync back in the other direction.
username: "fred"
password: "freds_password"
base_url: "https://jira.yourcompany.com"
jql_query: "assignee = \"fred\" AND project = NewProject AND status = Open"
{
"title": "Logstash Search",
"services": {
"query": {
"idQueue": [
1
],
"list": {
"0": {
"query": "*",
@mattfinlayson
mattfinlayson / gitchurn.sh
Created June 16, 2014 16:41
See the most edited files in a git repository
#!/bin/bash
git log --all -M -C --name-only --format='format:' "$@" | sort -n | grep -v '^$' | uniq -c | sort | tail -n 10
@mattfinlayson
mattfinlayson / gitty_up.rb
Created June 16, 2014 16:43
Prints a command line graph of when people commit: git log --pretty="format:%ai,%an"| ~/gitty.rb Assembled from an old 37signals post.
#!/usr/bin/ruby
require 'date';
people = {};
ARGF.each_line {
|l| time, author = l.split(',');
people[author] ||= Array.new(24, 0);
hour = DateTime.parse(time).hour;
people[author][hour] += 1;

Keybase proof

I hereby claim:

  • I am savagegus on github.
  • I am mattfinlayson (https://keybase.io/mattfinlayson) on keybase.
  • I have a public key whose fingerprint is 7BE1 BC3D F693 8233 6164 D983 3F11 5CCE F135 125C

To claim this, I am signing this object:

@mattfinlayson
mattfinlayson / os_x_version.sh
Created March 20, 2015 22:13
Bash for determining OS X Version (Mavericks)
#!/bin/bash -x
DARWINOS_MAJOR=`sysctl -n kern.osrelease | cut -d . -f 1`
DARWINOS_MINOR=`sysctl -n kern.osrelease | cut -d . -f 2`
OS_X_MAJOR="10" # For context
OS_X_MINOR=`echo ${DARWINOS_MAJOR}-4 | bc` # Magic apple convention
OS_X_REVISION="${DARWINOS_MINOR}" # For completeness
OS_X_VERSION="${OS_X_MAJOR}.${OS_X_MINOR}.${OS_X_REVISION}"
@mattfinlayson
mattfinlayson / DearDiary-Bridging-Header.h
Created June 12, 2015 23:25
DearDiary-Bridging-Header.h
//
// DearDiary-Bridging-Header.h
// DearDiary
//
// Created by Matthew Finlayson on 5/7/15.
// Copyright (c) 2015 Cesare Rocchi. All rights reserved.
//
#ifndef DearDiary_DearDiary_Bridging_Header_h
#define DearDiary_DearDiary_Bridging_Header_h
@mattfinlayson
mattfinlayson / SMLoginViewController.1.swift
Last active August 29, 2015 14:23
Snippets from BaasBox and Swift - Part 2
import Foundation
class SMLoginViewController : UIViewController {
@IBOutlet weak var loginView: UIView!
@IBOutlet weak var signupView: UIView!
@IBOutlet weak var segmentedControl: UISegmentedControl!
@IBOutlet weak var loginUsernameField: UITextField!
@IBOutlet weak var loginPasswordField: UITextField!
include classpath("application.conf")
application.code="1234567890"
orient.baasbox.path="/opt/baasbox/db/baasbox"
orient.baasbox.backup.path="/opt/baasbox/db/backup"
push.baasbox.certificates.folder="/opt/baasbox/certificates"
@mattfinlayson
mattfinlayson / install_consul.sh
Created April 21, 2016 18:03
Fast and dirty consul install
#!/usr/bin/env bash
set -e
export CONSUL_VERSION=0.6.3
export CONSUL_TEMPLATE_VERSION=0.12.1
echo "Fetching Consul..."
cd /tmp