Skip to content

Instantly share code, notes, and snippets.

View ChrisMissal's full-sized avatar
💭
set status

Chris Missal ChrisMissal

💭
set status
View GitHub Profile
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: [email protected]
web: http://company.com
twitter: company
github: hhattori
jorgen:
@BenHall
BenHall / cookies.js
Created January 19, 2012 17:06
How to get/set a cookie in Javascript
// Taken from: https://developer.mozilla.org/en/DOM/document.cookie
// docCookies.setItem("test1", "Hello world!");
// alert(docCookies.getItem("test1"));
docCookies = {
getItem: function (sKey) {
if (!sKey || !this.hasItem(sKey)) { return null; }
return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
},
setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
@jonsagara
jonsagara / EmptyGuid.sql
Last active May 20, 2025 16:43
Generating Guid.Empty in SQL Server
--
-- 2021-11-24: suggestion from comments:
--
DECLARE @EmptyEmpty UNIQUEIDENTIFIER = CAST(0x0 AS UNIQUEIDENTIFIER)
SELECT @EmptyEmpty
--
-- Original
--
public class ConcurrentLeastFrequentlyUse<T> where T : class
{
private readonly int[] generationSizes;
private readonly ConcurrentQueue<T>[] queues;
public ConcurrentLeastFrequentlyUse(params int[] generationSizes)
{
this.generationSizes = generationSizes;
queues =new ConcurrentQueue<T>[generationSizes.Length];
}