Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremiah Peschka peschkaj

View GitHub Profile
We couldn’t find that file to show.
View tag_list_after_refactor.rb
tags.each { |tag| tag_list << Tag.first_or_create(:name => tag.strip) }
@peschkaj
peschkaj / method one.cs
Created Feb 26, 2012
Potential CorrugatedIron conflict resolution mechanism
View method one.cs
public delegate T ResolveConflict<out T>(RiakObject theObject);
public T GetObject<T>(DeserializeObject<T> deserializeObject, ResolveConflict<T> resolveConflict = null)
{
if (deserializeObject == null)
{
throw new ArgumentException("deserializeObject must not be null");
}
if (Siblings.Count > 1 && resolveConflict != null)
@peschkaj
peschkaj / gist:2200634
Created Mar 25, 2012
MapReduce Index and GetObjects<T>
View gist:2200634
using System;
using System.Linq;
using System.Threading;
using System.Web;
using CorrugatedIron;
using CorrugatedIron.Comms;
using CorrugatedIron.Config;
using CorrugatedIron.Models;
using CorrugatedIron.Models.MapReduce;
using CorrugatedIron.Models.MapReduce.Inputs;
@peschkaj
peschkaj / hack.sh
Created Mar 31, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
View gist:3724770
DECLARE @rVal AS BIT ;
DECLARE @dbName AS sysname ;
DECLARE @command AS NVARCHAR(MAX)
DECLARE @error AS NVARCHAR(MAX) ;
DECLARE @newline AS NVARCHAR(2) ;
SET @error = N'' ;
SET @newline = NCHAR(13) + NCHAR(10) ;
DECLARE shrinklog CURSOR FAST_FORWARD READ_ONLY
@peschkaj
peschkaj / xbuild.out
Created Nov 18, 2012
CorrugatedIron xbuild output
View xbuild.out
XBuild Engine Version 2.10.9.0
Mono, Version 2.10.9.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 11/18/2012 6:49:19 AM.
__________________________________________________
Project "/Users/jeremiah/Projects/CorrugatedIron/CorrugatedIron.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Target Build:
View RiakSearchTest.cs
using System;
using CorrugatedIron;
using CorrugatedIron.Models;
using CorrugatedIron.Models.Search;
using CorrugatedIron.Models.MapReduce;
using CorrugatedIron.Util;
namespace MiscellaneousSamples
{
public class RiakSearch
View RiakDollarKeyExample.cs
using System;
using System.Linq;
using CorrugatedIron;
using CorrugatedIron.Models;
using CorrugatedIron.Models.MapReduce;
using CorrugatedIron.Models.MapReduce.Inputs;
using CorrugatedIron.Util;
namespace MiscellaneousSamples
{
View RiakIndex.cs
namespace CorrugatedIron.Models.MapReduce.Inputs
{
public static class RiakIndex
{
private static string RiakKeysIndex = "$key";
public static RiakIndexInput AllKeys(string bucket)
{
string first = "\u0000";
string last = char.ConvertFromUtf32(0x10FFFF);