Skip to content

Instantly share code, notes, and snippets.

View peschkaj's full-sized avatar

Jeremiah Peschka peschkaj

View GitHub Profile
@peschkaj
peschkaj / ci60s_timeout.xml
Created February 22, 2013 01:05
Configuring CorrugatedIron with a 60 second timeout.
<riakConfig nodePollTime="5000" defaultRetryWaitTime="200" defaultRetryCount="3">
<nodes>
<node name="riak@172.16.33.107" networkReadTimeout="60000" hostAddress="devUbuntu01" pbcPort="8087" restScheme="http" restPort="8098" poolSize="20" />
<node name="riak@172.16.33.138" networkReadTimeout="60000" hostAddress="devUbuntu02" pbcPort="8087" restScheme="http" restPort="8098" poolSize="20" />
<node name="riak@172.16.33.221" networkReadTimeout="60000" hostAddress="devUbuntu03" pbcPort="8087" restScheme="http" restPort="8098" poolSize="20" />
<node name="riak@172.16.34.56" networkReadTimeout="60000" hostAddress="devUbuntu04" pbcPort="8087" restScheme="http" restPort="8098" poolSize="20" />
</nodes>
</riakConfig>
/* Let's review your sales, Jenkins... */
WITH sales AS (
SELECT h.SalesPersonID ,
ROW_NUMBER() OVER (PARTITION BY h.SalesPersonID
ORDER BY DATEPART(yyyy, h.OrderDate),
DATEPART(mm, h.OrderDate)) AS rn ,
DATEPART(yyyy, h.OrderDate) AS [Year],
DATEPART(mm, h.OrderDate) AS [Month],
SUM(h.SubTotal) AS TerritoryTotal
FROM Sales.SalesOrderHeader AS h
@peschkaj
peschkaj / git-setup.sh
Created June 4, 2013 14:05
Git setup niceties
# via https://gist.github.com/419201#file_gitconfig.bash
# Install (from Matt's gist) these useful Git aliases & configurations with the following command:
# $ bash <(curl -s https://raw.github.com/gist/419201/gitconfig.bash)
git config --global color.ui auto # colorize output (Git 1.5.5 or later)
git config --global color.interactive auto # and from 1.5.4 onwards, this will works:
echo "Set your name & email to be added to your commits."
echo -n "Please enter your name: "
@peschkaj
peschkaj / .gitconfig
Created June 4, 2013 15:42
It's a gitconfig file!
[user]
email = jeremiah.peschka@gmail.com
name = Jeremiah Peschka
[github]
user = peschkaj
[core]
autocrlf = input
safecrlf = true
excludesfile = /Users/jeremiah/.gitignore
editor = subl
@peschkaj
peschkaj / test-client.cs
Last active December 18, 2015 14:08
A test of the Cassandra .NET client
using System;
using System.Collections.Generic;
using System.Linq;
using Cassandra.Data.Linq;
using Cassandra;
namespace CassandraTest
{
[AllowFiltering]
[Table("sales")]
"\0\0\0\0\0\nriak_index_testssandwiches_int*2258\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
{byte[256]}
[0]: 0
[1]: 0
[2]: 0
[3]: 0
[4]: 0
[5]: 10
[6]: 16
[7]: 114
[8]: 105
public RiakResult<IEnumerable<string>> StreamListBuckets()
{
var lbReq = new RpbListBucketsReq { stream = true };
var result = UseDelayedConnection((conn, onFinish) =>
conn.PbcWriteStreamRead<RpbListBucketsReq, RpbListBucketsResp>(lbReq, lbr => lbr.IsSuccess && !lbr.Value.done, onFinish));
if(result.IsSuccess)
{
var buckets = result.Value.Where(r => r.IsSuccess).SelectMany(r => r.Value.buckets).Select(k => k.FromRiakString());
return RiakResult<IEnumerable<string>>.Success(buckets);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra;
using Cassandra.Data;
using Cassandra.Data.Linq;
using metrics.Core;
using metrics.Reporting;
using System.Diagnostics;
@peschkaj
peschkaj / DatastaxDriverTest.cs
Created July 8, 2013 22:39
Cassandra C# driver CassandraNoHostException
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra;
using Cassandra.Data;
using Cassandra.Data.Linq;
using metrics.Core;
using metrics.Reporting;
using System.Diagnostics;