Skip to content

Instantly share code, notes, and snippets.

View stevomccormack's full-sized avatar

Steve McCormack stevomccormack

View GitHub Profile
@stevomccormack
stevomccormack / Kase-Cart-IIFE.liquid.js
Last active May 15, 2018 18:58
KASE.com AJAX Cart Scripting using Immediately Invoked Function Expression (IIFE)
/*!
Theme Name: Kase Shopify Development
Author URI: https://mwebsolutions.com.au
Description: Developed by Steve McCormack for MWeb Solutions
Version: 1.1
Author: Steve McCormack
*/
// IIFE - Immediately Invoked Function Expression
@stevomccormack
stevomccormack / DML-Output.sql
Last active May 15, 2018 18:57
CodeSmith Tools - Stored Procedures (CRUD) Generator - Source & Output for all DML and Select cases for all web development use cases (more available - ommitted).
--region Drop Existing Procedures
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[InsertAthlete]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[InsertAthlete]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[InsertAllAthlete]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[InsertAllAthlete]
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UpdateAthlete]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[UpdateAthlete]
@stevomccormack
stevomccormack / DoubleLockSingleton.cs
Last active May 15, 2018 07:20
Singleton Design Pattern - for single & multi-thread environment
namespace Patterns.Threading
{
/// <summary>
/// Singleton Design Pattern for multi-thread environment
/// </summary>
/// <remarks>Uses double-checked locking method - effective but expensive locking mechanism with least control.</remarks>
public sealed class DoubleLockSingleton
{
private static readonly object _sync = new object();
private static DoubleLockSingleton _instance;
/* https://drafts.csswg.org/mediaqueries-4/ */
/* Portrait */
@media screen and (orientation:portrait) {
}
/* Landscape */
@media screen and (orientation:landscape) {
/* https://drafts.csswg.org/mediaqueries-4/ */