Skip to content

Instantly share code, notes, and snippets.

Create Function dbo.fn_ConvertCSVtoTable ( @input nvarchar(max), @token nchar(1))
Returns @Result Table
(ColumnValue nvarchar(max))
As
Begin
Declare @x XML
Select @x = CAST('<CSV>'+ REPLACE(@input, @token,'</CSV><CSV>')+ '</CSV>' AS XML)
var fs = require('fs'),
path = require('path'),
Promise = require('rsvp').Promise,
request = require('request'),
files = [
'https://www.google.com/images/srpr/logo11w.png',
'http://rack.1.mshcdn.com/media/ZgkyMDEzLzA5LzE2L2JjL0Jpbmdsb2dvb3JhLmFkYjJkLnBuZwpwCXRodW1iCTEyMDB4OTYwMD4/996d9598/35b/Bing-logo-orange-RGB.png',
'http://assets.fontsinuse.com/static/use-media-items/15/14246/full-2048x768/52c4c6bc/Yahoo_Logo.png'
namespace TestinNancyWithOwinTesting
{
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Testing;
using Owin;
using Microsoft.Owin.Testing;
Assuming your web app supports deep linking, like an AngularJS one would.
Assume basic crud of Foo. So list, create, edit and delete.
If a user bookmarks in your app an edit page eg/http://mydomain.com/foo/123, thanks to deep linking you now skip over the list part of navigation.
So the user's browser hits:
http://example.org/#/foos/1
@jchannon
jchannon / NancyOwinSelfHostWindowsAuth.cs
Last active September 22, 2015 11:40 — forked from damianh/NancyOwinSelfHostWindowsAuth.cs
Nancy owin self hosting with Microsoft.Owin.HttpListener and windows authentication on .NET 4.0 (Personal opinion: avoid windows NTLM auth in web applications, even intranet ones. Use standards based SSO.)
namespace ConsoleApplication1
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Security.Principal;
using Microsoft.Owin.Hosting;
using Nancy;
using Owin;
@jchannon
jchannon / recipes.go
Last active November 2, 2015 17:41 — forked from philcleveland/routes.go
Currently how I define my routes for api's in Go. Up for discussion
type Recipe struct{}
func NewRecipe(*router router) *router {
router.HandleFunc("/recipe/{id}", GetById)
}
func GetById(writer w, *request r) *handler {
//do something
}
@jchannon
jchannon / httpStatusCodes.js
Created April 23, 2016 12:41 — forked from marlun78/httpStatusCodes.js
An HTTP Status Codes object
/**
* HTTP Status Codes
* Copyright (c) 2012, marlun78
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83
*
* Taken from: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
* Visual Studio find regex: ^(\d{3}) ([^\r\n]+)\r\n
* Visual Studio replace regex: '$1': '$2', //
* Notes wrapped in parens moved manually
*/
@jchannon
jchannon / ToDynamic.cs
Created October 17, 2017 19:15 — forked from orhanveli/ToDynamic.cs
Object or Array to Dynamic in C#
public static class Extensions
{
public static dynamic ToDynamic(this object value)
{
if (value.IsListOrArray ()) {
var list = new List<ExpandoObject> ();
IEnumerable enumerable = value as IEnumerable;
foreach (object o in enumerable) {
list.Add (o.ToDynamic ());