Skip to content

Instantly share code, notes, and snippets.

View tekiegirl's full-sized avatar
😁
Spinning and connecting all the plates

Jacqui Read tekiegirl

😁
Spinning and connecting all the plates
View GitHub Profile
@tekiegirl
tekiegirl / BabyNames
Last active August 29, 2015 14:06
Baby Names Graph Gist
== Baby Names Graph
:neo4j-version: neo4j-2.1
:author: Jacqui Read
:twitter: @tekiegirl
=== Initial Data Setup
//setup
//hide

Baby Names Graph

Initial Data Setup

// Seed code from Configuration.cs
protected override void Seed(DAL.Models.Context context)
{
// This method will be called after migrating to the latest version.
// Default Customers - create
var customers = new[]{
new Customer { Name = "cust_a" },
new Customer { Name = "cust_b" },

Calendar

Initial Data Setup

@tekiegirl
tekiegirl / GetSessionIdCookieName
Created October 28, 2013 17:26
Progromatically get SessionId Cookie name used in an asp.net application
using System.Configuration;
using System.Web.Configuration;
internal string GetSessionIdCookieName()
{
SessionStateSection sessionStateSection = (SessionStateSection)ConfigurationManager
.GetSection("system.web/sessionState");
return sessionStateSection != null ? sessionStateSection.CookieName : null;
}
@tekiegirl
tekiegirl / EntityFrameworkHack
Created October 28, 2013 17:16
Getting Entity Framework to recognise the return type of a Stored Procedure that returns a #temp table
IF 1 = 2
BEGIN
SELECT
cast(null as int) as UserId
,cast(null as nvarchar(250)) as Username
,cast(null as int) as RoleCount
,cast(null as datetime) as UserRevoked
,cast(null as bit) as Locked
,cast(null as bit) as ForcePassChange
,cast(null as varchar(200)) as ClientName
@tekiegirl
tekiegirl / CheckValid
Created October 28, 2013 17:32
Get the executing assembly of a web app referencing a class library
private static bool CheckValid(string controller, string action)
{
if (!controller.Contains("Controller"))
{
controller = controller + "Controller";
}
// Get assembly
Assembly a = GetWebEntryAssembly();
if (a != null)
{

Ranked rule-based subgraph matching

In order to rank possible matches by relevence I wish to return a score, with different matches addingg a different value to the score, and a list of the items that matched (a list of strings). More matches the higher the rank should be.

Setup of known data

@tekiegirl
tekiegirl / merge.adoc
Last active December 30, 2015 06:19
Does MERGE work the same for relationships as CREATE UNIQUE did?
@tekiegirl
tekiegirl / existing.sql
Created March 24, 2016 14:36
Adding a relationship constraint to an existing or new column in MS SQL
ALTER TABLE [dbo].[MyTable]
ADD CONSTRAINT FK_MyTable_OtherTable FOREIGN KEY (OType)
REFERENCES [dbo].[OtherTable] (Ident)
ON DELETE CASCADE
ON UPDATE CASCADE