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
--------------------------------------------------------------------------------
-- WORKSHOP BASICS NEO4J
-- https://tinyurl.com/workshop-neo4j-basics-ita
--------------------------------------------------------------------------------
--------------------------------------------------------------------- CONTRAINTS
/// constraint unique on movie title
CREATE CONSTRAINT title_uniqueness ON (m:Movie) ASSERT m.title IS UNIQUE;
@cskardon
cskardon / MonitorFolder.ps1
Created February 1, 2018 15:12
A PowerShell script to monitor a folder and executing Cypher when a new file is added
$global:folder = 'c:\temp\imports' # The root folder being monitored.
$filter = '*.csv' # File types we're looking for.
$global:archiveFolder = 'c:\temp\imports\archive' # The archive root folder
$global:cypherShellLocation = 'd:\databases\neo4j\enterprise\neo4j-enterprise-3.3.0\bin\cypher-shell.bat' # The location of the cypher-shell.bat file
$global:user = "neo4j"
$global:password = "neo"
# A watcher to watch
$fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $false;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}

Keybase proof

I hereby claim:

  • I am cskardon on github.
  • I am cskardon (https://keybase.io/cskardon) on keybase.
  • I have a public key ASAJ4USySBXduTD99vwlOImo80TpjNQ_2Yzc0g5D1HPCzgo

To claim this, I am signing this object:

@cskardon
cskardon / ActorProcedures.java
Created June 1, 2017 10:27
An example proc for a blog post on xclave.co.uk - proper link will pop up soon
package movie;
import common.MapResult;
import org.neo4j.procedure.Context;
import org.neo4j.procedure.Name;
import org.neo4j.procedure.Procedure;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@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)
*/
@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 / 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 / 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;
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 / 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),