Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremiah Peschka peschkaj

View GitHub Profile
@peschkaj
peschkaj / ci60s_timeout.xml
Created Feb 22, 2013
Configuring CorrugatedIron with a 60 second timeout.
View ci60s_timeout.xml
<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>
View lag.sql
/* 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 Jun 4, 2013
Git setup niceties
View git-setup.sh
# 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 Jun 4, 2013
It's a gitconfig file!
View .gitconfig
[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 Dec 18, 2015
A test of the Cassandra .NET client
View test-client.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Cassandra.Data.Linq;
using Cassandra;
namespace CassandraTest
{
[AllowFiltering]
[Table("sales")]
View message with show_terms
"\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"
View messageBody first 100 bytes
{byte[256]}
[0]: 0
[1]: 0
[2]: 0
[3]: 0
[4]: 0
[5]: 10
[6]: 16
[7]: 114
[8]: 105
View ListBuckets.cs
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);
View DatastaxDriverTest.cs
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 Jul 8, 2013
Cassandra C# driver CassandraNoHostException
View DatastaxDriverTest.cs
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;