Skip to content

Instantly share code, notes, and snippets.

Andy Conlisk AndyConlisk

  • Conlisk Consulting
  • Louisville, KY
Block or report user

Report or block AndyConlisk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AndyConlisk / generateUUID.js
Created Jun 14, 2017
generate a UUID / GUID in javascript
View generateUUID.js
function generateUUID() {
var d = new Date().getTime();
if (window.performance && typeof === "function") {
d +=;; //use high-precision timer if available
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
AndyConlisk / Model1.cs
Created May 13, 2017
Example Entity Framework One to Many and Many to Many
View Model1.cs
namespace ComplexEntityFramework
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
public class Model1 : DbContext
public Model1()
: base("name=Model1")
AndyConlisk / FindRemoveDuplicates.sql
Created Mar 8, 2017
Finding and removing duplicate rows from database
View FindRemoveDuplicates.sql
-- SQL databate table dbo.Test with columns Id, FirstName, LastName, TransactionNumber, LastUpdatedDate
-- Select rows that are duplicates without using LastUpdatedDate
-- If needed can insert into a backup/archive table
SELECT t.Id, t.FirstName, t.LastName, t.TransactionNumber, t.LastUpdatedDate
FROM dbo.Test t
FirstName, LastName, TransactionNumber
FROM dbo.Test
AndyConlisk / projectsetupdescription.txt
Created Mar 2, 2017
Description on setting up MVC web projects
View projectsetupdescription.txt
This namespace should contain all functionality that is not expansive enough to be in its own project but are required by multiple consumers/projects
- Logging and other cross access functions
- Generic helper classes for logging.
- Non-domain specific, independent functionality, and Profiling. Such as .NET Extension methods.
This namespace contains the domain objects.
- Domain Objects (POCO), Shared data transfer objects, Models, ViewModels, etc
- Business logic for Validators, Filters, Factories, Regular expressions
View gist:dd539a1ebff2d6b3bd0bb32f3007d0a6
### Keybase proof
I hereby claim:
* I am andyconlisk on github.
* I am kingpancake ( on keybase.
* I have a public key ASALMMqf4SM6CNyfc95F_w2_aYcKnvvdEA9bENXjbTLrlAo
To claim this, I am signing this object:
AndyConlisk / combinemultiplerowintoone.sql
Created Sep 20, 2016
SQL select statement to combine multiple row vales into one field
View combinemultiplerowintoone.sql
SELECT p.Name, substring
((SELECT ', ' + k.Number FROM dbo.Keys k
JOIN dbo.Keys_Assignments ka ON ka.KeyID = k.KeyID
WHERE ka.PersonID = p.PersonID
FOR XML PATH('')), 2, 1000) [Keys]
FROM dbo.People p
((SELECT '; ' + p.Name FROM dbo.People p
AndyConlisk / sql_findTableUsageInStoredProc
Last active Aug 29, 2015
SQL statment to find all instances of utility in stored procs
View sql_findTableUsageInStoredProc
SELECT DISTINCT FROM syscomments sc INNER JOIN sysobjects so on WHERE sc.text LIKE '%utility%'
AndyConlisk / ProductRandomImage.sql
Created Jan 5, 2015
SQL to get a random image from a product of the product category
View ProductRandomImage.sql
SELECT b.Id AS BusinessId, COALESCE(subCategoryImage.Id, parentCategoryImage.Id) AS ImageAssetId, COALESCE(subCategoryImage.CategoryId, parentCategoryImage.CategoryId) AS CategoryId, b.Name, COALESCE(subCategoryImage.FileName, parentCategoryImage.FileName) AS FileName
FROM Businesses b
FROM ImageAssets
WHERE CategoryId = b.CategoryId
AND Deleted = 0
) subCategoryImage
AndyConlisk / Background.cs
Created Jan 3, 2015
Simple Background Tasks for ASP.NET
View Background.cs
//Easy Background tasks in ASP.NET projects
//Inspiration from
//This code is added into the Global.asax file. In the Application_Start() method
private static CacheItemRemovedCallback OnCacheRemove = null;
protected void Application_start()
//The register code that is put in here
//Here is where you add all the tasks you want to start on application start
You can’t perform that action at this time.