Skip to content

Instantly share code, notes, and snippets.

View PureKrome's full-sized avatar
💭
🦘🕺🏻🎶🕹

Justin Adler PureKrome

💭
🦘🕺🏻🎶🕹
View GitHub Profile
@PureKrome
PureKrome / gist:1470112
Created December 13, 2011 02:06
Shapefile for Los Angeles
-- Shape of Los Angeles.
DECLARE @WKT VARCHAR(MAX) = 'POLYGON ((-118.66815700000011 34.181235000000029, -118.66815300000009 34.17675000000002, -118.6674110000001 34.176747000000027, -118.66679500000011 34.176747000000027, -118.66445800000008 34.176749000000022, -118.66236300000008 34.176749000000022, -118.66110500000008 34.176749000000022, -118.65858900000011 34.176749000000022, -118.6585930000001 34.176059000000016, -118.6591990000001 34.175738000000024, -118.6586190000001 34.17567500000002, -118.6592830000001 34.175361000000024, -118.65948600000009 34.175234000000017, -118.65898700000008 34.175218000000029, -118.65859800000008 34.175209000000024, -118.65859800000008 34.175051000000025, -118.65860900000008 34.173095000000025, -118.65860900000008 34.173025000000017, -118.65861800000009 34.17151700000003, -118.65861800000009 34.171419000000022, -118.65862900000009 34.16944000000003, -118.65872700000008 34.169398000000029, -118.65872600000009 34.169368000000027, -118.6587210000001 34.169276000000025, -118.6580
namespace RavenLinqpadDriver
{
public class RavenContext : IDocumentSession
{
private IDocumentStore _docStore;
private IDocumentSession _session;
internal TextWriter LogWriter { get; set; }
public RavenContext(RavenConnectionInfo connInfo)
{
private readonly IWebService _webService;
public DocumentController(IWebService webService)
{
_webService = webService;
}
public ActionResult Index(int? id)
{
@PureKrome
PureKrome / gist:5184077
Created March 17, 2013 23:19
Just some .gitattributes file
# Set behaviour for all files, in case developers don't have core.autocrlf set.
* text=auto
# Explicitly declare text files we want to always be normalized and converted to native line endings on checkout.
*.txt text
# Declare files that will always have CRLF line endings on checkout.
*.cs diff=csharp
*.sln text eol=crlf
@PureKrome
PureKrome / gist:5393915
Created April 16, 2013 06:58
Sample RavenDb Index that has related documents. (Not 100% working)
public class GameServers_ConnectedClients :
AbstractIndexCreationTask<GameServer, GameServers_ConnectedClients.QueryResult>
{
public GameServers_ConnectedClients()
{
Map = gameServers => from gameserver in gameServers
where gameserver.IsActive
select new
{
ServerName = gameserver.Name,
@PureKrome
PureKrome / gist:5522741
Created May 6, 2013 00:40
RavenDb bulk insert example.
using System;
using System.Collections.Generic;
using System.Linq;
using Raven.Client.Document;
namespace ConsoleApplication6
{
internal class Program
{
private static void Main(string[] args)
@PureKrome
PureKrome / gist:5524046
Last active March 17, 2017 11:45
Sample AutoComplete with RavenDb.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
using Raven.Client.Indexes;
using WorldDomination.Raven.Client;
declare @xx geography = geography::STGeomFromText('POLYGON ((150.31868195533752 -30.37122917175293, 150.31904888153076 -30.371218204498291, 150.31941103935242 -30.371195793151855, 150.31995010375977 -30.371133804321289, 150.32048797607422 -30.371033191680908, 150.32102203369141 -30.370902061462402, 150.32155108451843 -30.3707537651062, 150.32207489013672 -30.37060022354126, 150.32253503799438 -30.370456218719482, 150.32299089431763 -30.370298862457275, 150.3234429359436 -30.370132923126221, 150.32389092445374 -30.369959831237793, 150.32433795928955 -30.369784832000732, 150.32445693016052 -30.369738101959229, 150.32457590103149 -30.369690895080566, 150.32469511032104 -30.369643211364746, 150.32481288909912 -30.369595050811768, 150.32493209838867 -30.369546890258789, 150.32614493370056 -30.369626998901367, 150.32706093788147 -30.369225978851318, 150.32732701301575 -30.368931770324707, 150.32803988456726 -30.36830997467041, 150.32922196388245 -30.368507862091064, 150.33077692985535 -30.369443893432617, 150.33187
@PureKrome
PureKrome / gist:5529128
Created May 6, 2013 23:31
Another autocomplete Ravendb test.
using System;
using System.Collections.Generic;
using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
namespace ConsoleApplication6
@PureKrome
PureKrome / gist:5607527
Created May 19, 2013 12:37
PLaying around with RavenDb and sessions.
using System;
using System.Linq;
using Raven.Client.Document;
namespace ConsoleApplication7
{
internal class Program
{
private static void Main(string[] args)
{