Skip to content

Instantly share code, notes, and snippets.

@NickJosevski
NickJosevski / git.config
Created August 15, 2012 00:28
Beyond Compare .GitConfig
## .gitconfig
[alias]
dt = difftool
mt = mergetool
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
@NickJosevski
NickJosevski / guids.md
Last active September 18, 2017 00:35
Used Guids, share the love.

Used Guid Reporting

Ever wondered if that that GUID you're about to use has already been consumed?

No.

Well you should. Check the twitter feed - twitter.com/UsedGuid, and start reporting your usage of GUIDs. It's the right thing to do.

Throw away those old paper based systems.

@NickJosevski
NickJosevski / U2DCheckVerbosity.cmd
Created June 20, 2017 04:41
Trying to set U2DCheckVerbosity
@echo off
setlocal EnableDelayedExpansion
set U2DCheckVerbosity=1
set BatchFile=%0
if not exist "%VS150COMNTOOLS%" (
echo This script needs to be run from an elevated Visual Studio 2017 developer command prompt.
exit /b 1
)
@NickJosevski
NickJosevski / UsedGuidBasicInput.csx
Last active September 10, 2016 10:45
AzureFunctions - UsedGuidBasicInput
using System.Net;
public class Input
{
public string Guid {get;set;}
public string UsedBy { get;set;}
}
public static async Task<HttpResponseMessage>
Run(HttpRequestMessage req, TraceWriter log)
function Select-Folder($message='Select a folder', $path = 0) {
$object = New-Object -comObject Shell.Application
$folder = $object.BrowseForFolder(0, $message, 0, $path)
if ($folder -ne $null) {
$folder.self.Path
}
}
function Add-Zip
@NickJosevski
NickJosevski / jira-cookie-auth-comment-post.fs
Last active April 8, 2016 11:53
Cookie based authentication with JIRA (F# and RestSharp)
open RestSharp
type PostData = {
body: string
}
type Login = {
username : string
password : string
}
@NickJosevski
NickJosevski / FSharpOptionConverter.cs
Last active March 5, 2016 20:26
FSharpOptionConverter : JsonConverter
public class FSharpOptionConverter : JsonConverter
{
private static MethodInfo _getInnerValue = typeof (FSharpOptionConverter).GetMethod("GetInnerValue",
BindingFlags.Instance |
BindingFlags.NonPublic);
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (value != null)
{
var optionValueType = value.GetType().GetGenericArguments().Single();
@NickJosevski
NickJosevski / sqlpurgeloop.sql
Created December 10, 2012 04:29
purge loop, why?
SET @rows = 5 --default
IF @purgeDate is NULL SET @purgeDate=getdate()
-- Only execute if there is work to do and continue
-- until all records with a PurgeDate <= now are deleted
WHILE EXISTS(SELECT * FROM WorkItemStatus WHERE PurgeDate <= @purgeDate)
BEGIN
@NickJosevski
NickJosevski / jQuery.ajaxQueue.coffee
Created November 25, 2012 02:29
CoffeeScript version of jQuery.ajaxQueue
# <reference path="jquery-1.8.0.min.js" />
# from: https:#gist.github.com/1039247
###
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Corey Frang
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
@NickJosevski
NickJosevski / equatable.cs
Created September 18, 2012 03:42
IEquatable<T> Interface implementation
protected bool Equals(MyClass other)
{
return Equals(Id, other.Id) && Equals(Name, other.Name) && Equals(Desc, other.Desc);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;