Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Robb joshrobb

  • Auckland, New Zealand
View GitHub Profile
View bbqsauce.txt
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 — forked from pwenzel/git-log-to-tsv.sh
Git Log to Tab-Delimited CSV File
View git-log-to-tsv.sh
# 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 Mar 27, 2016
Try to figure out how many tests Team city thinks ran between two dates.
View teamcity-build-test-queries.sql
--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
View platformstats.linqpad
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
};
View LongRunningNHOperation.cs
public class LongRunningNHOperation : IDisposable
{
SessionScope session;
int newsessioncount = 250;
Stopwatch stopwatch = Stopwatch.StartNew();
private LongRunningNHOperation() { }
@joshrobb
joshrobb / librato-deploy.ps1
Created Nov 2, 2014
Octopus Deploy Annotate Librato
View librato-deploy.ps1
$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
View AutofacStrategyPattern.cs
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
View keybase.md

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:

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