Skip to content

Instantly share code, notes, and snippets.

Nick Josevski NickJosevski

Block or report user

Report or block NickJosevski

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
@NickJosevski
NickJosevski / U2DCheckVerbosity.cmd
Created Jun 20, 2017
Trying to set U2DCheckVerbosity
View U2DCheckVerbosity.cmd
@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 Sep 10, 2016
AzureFunctions - UsedGuidBasicInput
View UsedGuidBasicInput.csx
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)
@NickJosevski
NickJosevski / jira-cookie-auth-comment-post.fs
Last active Apr 8, 2016
Cookie based authentication with JIRA (F# and RestSharp)
View jira-cookie-auth-comment-post.fs
open RestSharp
type PostData = {
body: string
}
type Login = {
username : string
password : string
}
@NickJosevski
NickJosevski / FSharpOptionConverter.cs
Last active Mar 5, 2016
FSharpOptionConverter : JsonConverter
View FSharpOptionConverter.cs
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();
View keybase.md

Keybase proof

I hereby claim:

  • I am NickJosevski on github.
  • I am nickjosevski (https://keybase.io/nickjosevski) on keybase.
  • I have a public key whose fingerprint is 10C1 1301 4FA9 EAD5 7752 A6A2 E52B 0ADD 1554 99B8

To claim this, I am signing this object:

View FSharpOptionObjectMapper.cs
public class FSharpOptionObjectMapper : IObjectMapper
{
public object Map(ResolutionContext context, IMappingEngineRunner mapper)
{
var sourceValue = ((dynamic) context.SourceValue);
return (sourceValue == null || OptionModule.IsNone(sourceValue)) ? null : sourceValue.Value;
}
public bool IsMatch(ResolutionContext context)
View sqlpurgeloop.sql
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 Nov 25, 2012
CoffeeScript version of jQuery.ajaxQueue
View jQuery.ajaxQueue.coffee
# <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 / guids.md
Last active Sep 18, 2017
Used Guids, share the love.
View guids.md

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 / equatable.cs
Created Sep 18, 2012
IEquatable<T> Interface implementation
View equatable.cs
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;
You can’t perform that action at this time.