Skip to content

Instantly share code, notes, and snippets.

View joshrobb's full-sized avatar

Josh Robb joshrobb

  • Auckland, New Zealand
View GitHub Profile
Southern Succor Rub
1/4 cup ground black pepper
1/4 cup paprika
1/4 cup Turbinado sugar 2 Tablespoons table salt
2 teaspoons dry mustard
1 teaspoon cayenne pepper
Smoking wood
Southern Sop
@joshrobb
joshrobb / git-log-to-tsv.sh
Created May 14, 2016 02:05 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@joshrobb
joshrobb / teamcity-build-test-queries.sql
Created March 27, 2016 01:49
Try to figure out how many tests Team city thinks ran between two dates.
--for a given build id - what time was it added/removed from the queue (in UTC + 13)
select *,dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*1000), '1970-01-01 13:00')), dateadd(ms, remove_from_queue_time%(3600*24*1000), dateadd(day, remove_from_queue_time/(3600*24*1000), '1970-01-01 13:00'))
from build_state b inner join stats s on b.build_id = s.build_id
where dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*1000), '1970-01-01 13:00')) <= '2016-03-25'
and dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*1000), '1970-01-01 13:00')) > '2016-03-24'
select sum(test_count), min( dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*1000), '1970-01-01 13:00'))), max( dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*1000), '1970-01-01 13:00')))
from build_state b inner join stats s on b.build_id = s.build_id
where dateadd(ms, queued_time%(3600*24*1000), dateadd(day, queued_time/(3600*24*100
@joshrobb
joshrobb / platformstats.linqpad
Last active August 29, 2015 14:16
Team Stats
var github = new GitHubClient(new ProductHeaderValue("PushpayTech"));
var tokenAuth = new Credentials("XXX");
github.Credentials = tokenAuth;
var releases = await github.Release.GetAll("pushpay","pushpay");
var prfilter = new PullRequestRequest {
State = ItemState.All
};
public class LongRunningNHOperation : IDisposable
{
SessionScope session;
int newsessioncount = 250;
Stopwatch stopwatch = Stopwatch.StartNew();
private LongRunningNHOperation() { }
@joshrobb
joshrobb / librato-deploy.ps1
Created November 2, 2014 02:27
Octopus Deploy Annotate Librato
$encoded = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("user@example:apikey" ))
$headers = @{Authorization = "Basic "+$encoded}
if ($OctopusEnvironmentName -eq 'Production') {
$envname = "prod"
} else {
$envname = "qa"
}
#OH yeah - that doesn't work @#$@#$@#$@#$@#$@#$ in PS2
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Autofac.Features.Indexed;
namespace AutofacStrategyPattern

Keybase proof

I hereby claim:

  • I am joshrobb on github.
  • I am josh_robb (https://keybase.io/josh_robb) on keybase.
  • I have a public key whose fingerprint is DE5E B120 E661 1512 A8AC 4247 1229 F31C 1776 4041

To claim this, I am signing this object:

using System;
using System.Diagnostics;
using Pushpay.Core;
using StatsdClient;
namespace Pushpay.Base
{
public static class Stats
{
static readonly string Prefix = GetPrefix();
NSString *reachabilityType = @"";
Reachability *reach = [Reachability reachabilityForInternetConnection];
if ([reach isReachableViaWiFi]){
reachabilityType = @"wifi";
} else if ([reach isReachableViaWWAN]){