Skip to content

Instantly share code, notes, and snippets.

View cskardon's full-sized avatar
🧵
Sewing a lot at the moment

Charlotte Skardon cskardon

🧵
Sewing a lot at the moment
View GitHub Profile
@cskardon
cskardon / neo4j-fsharp-basics.fs
Last active December 18, 2021 16:26
Basic usage of Neo4j from F# (http://geekswithblogs.net/cskardon/archive/2013/11/27/using-neo4j-with-f-ndash-cypher-2.0.aspx) Check the URL for your local Neo4j server!
open System
open Neo4jClient
open System.Linq
[<CLIMutable>]
type Person = { Name:string; Twitter:string }
[<CLIMutable>]
type Knows = { How:string }
@cskardon
cskardon / like-dislike.cs
Created December 9, 2013 10:47
Simple example of creating and relating users together in C# with Neo4jClient.
using System;
using System.Linq;
using Neo4jClient;
using Neo4jClient.Cypher;
using Newtonsoft.Json;
public class LikesAndDislikes
{
#region Data objects
@cskardon
cskardon / like-dislike-generic-create.cs
Created December 10, 2013 08:08
Same as https://gist.github.com/cskardon/7870411 but with a generic Create extension method
using System;
using System.Linq;
using Neo4jClient;
using Neo4jClient.Cypher;
using Newtonsoft.Json;
#region Data objects
public enum Relationship
{
@cskardon
cskardon / neo4j-fsharp-basics-1.fs
Created January 7, 2014 14:53
Updated version of neo4j-fsharp-basic.fs (https://gist.github.com/cskardon/7673426) to use a Lambda expression for the return.
open System
open Neo4jClient
open Neo4jClient.Cypher
open System.Linq
open Microsoft.FSharp.Linq.RuntimeHelpers
[<CLIMutable>]
type Person = { Name:string; Twitter:string }
[<CLIMutable>]
@cskardon
cskardon / Wikitrie.txt
Created January 28, 2014 11:46
Wikitrie
*Wikipedia Trie*
This will generate a super simple (and it is super simple) Trie based on the Wikipedia entry on, well, Tries (see http://en.wikipedia.org/wiki/Trie), and _then_ look at how we can use that to do some simple things like intellisense and spelling guidance.
//hide
//setup
[source,cypher]
----
CREATE
(initial:en_GB),
using System;
using Neo4jClient;
using Neo4jClient.Cypher;
internal class Question_22041696
{
private class CityEntity { public int Id { get; set; } }
private class CompanyEntity { public int Id { get; set; } }
private class ProfessionEntity { public int Id { get; set; } }
@cskardon
cskardon / CompatibilityCheckingNeo4jClientFromFSharp.cs
Created April 2, 2014 14:13
Compatibility check for F# calling to Neo4jClient
using System;
using System.Linq.Expressions;
public class CSharpLibrary
{
public static bool CheckCompatibility<TResult>(Expression<Func<TResult>> expression)
{
if (expression.Body.NodeType != ExpressionType.MemberInit)
return false;
@cskardon
cskardon / question_26818882_poc.cs
Last active August 29, 2015 14:10
POC for http://stackoverflow.com/questions/26818882 (wild char search when parameterized)
/// <summary>
/// http://stackoverflow.com/questions/26818882
/// Neo4jClient: Wild char Search do not work when parametarized
/// </summary>
namespace Question_26818882
{
using Neo4jClient;
using System;
using System.Collections.Generic;
using System.Linq;
@cskardon
cskardon / Neo4jClientIsBack.md
Last active January 22, 2016 13:18
Neo4jClient 1.1.0.1 -> 1.1.0.5

#Neo4jClient - It's Back!

###The Past

For those in the know - the main .NET client for Neo4j is Neo4jClient - it was developed by Tatham Oddie for the last few years and had reached a nice stable point. Tatham has had to take a more off-hand role - something called 'LIFE' has happened :) So, I (Chris - Hello!) have taken over the management of the Neo4jClient.

###The Now

The last Neo4jClient version prior to my taking over was 1.0.0.665 - which was stable and included a large amount of Cypher functionality, but crucially was missing Transaction support. As luck would have it the Transaction code (written by Arturo Sevilla) was sitting in a pull request.

@cskardon
cskardon / Neo4jClient.Tx.Rest.Bolt.cs
Created March 8, 2017 15:00
LinqPad Transactions with Neo4jClient - using REST and BOLT
/*
LinqPad available from: https://www.linqpad.net/
Settings:
- Language = 'C# Program'
- Nuget
- Neo4jClient (min: 3.0.0-Bolt-Driver00026) [Use Development MyGet: https://www.myget.org/F/cskardon/api/v3/index.json]
- Neo4j.Driver (min: 1.1.2)
- System.Net.Http (min: 4.3.1)
*/