Skip to content

Instantly share code, notes, and snippets.

// This file is based on the code from the ASP.NET Core repository
// https://github.com/aspnet/AspNetCore/tree/master/src/Middleware/SpaServices.Extensions/src
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
@hoangitk
hoangitk / what-is-svelte.md
Created August 20, 2019 02:31 — forked from Rich-Harris/what-is-svelte.md
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@hoangitk
hoangitk / msbuild-get-date.proj
Created July 18, 2019 09:47 — forked from sayedihashimi/msbuild-get-date.proj
MSBuild how to get a good formatted date
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Demo" >
<Target Name="Demo">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-mmss))</CurrentDate>
</PropertyGroup>
@hoangitk
hoangitk / UsageNHibernateAsync.cs
Created July 17, 2019 07:25 — forked from erdtsieck/UsageNHibernateAsync.cs
This gist shows how to use the NHibernate async API
#region ICriteria async API
// Usage ICriteria.ListAsync<T>()
var customers = await session.CreateCriteria<Customer>().ListAsync<Customer>();
// Usage ICriteria.UniqueResultAsync<T>()
var customer = await session
.CreateCriteria<Customer>()
.Add(Restrictions.Eq("Name", "Erdtsieck"))
.UniqueResultAsync<Customer>();
@hoangitk
hoangitk / app_offline.htm
Created July 15, 2019 09:37 — forked from robert-claypool/app_offline.htm
A simple "app offline" template for ASP.NET
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Offline</title>
</head>
<body style="margin:3em;font-family:sans-serif">
<h2>Offline</h2>
<p>This site is offline for maintenance.</p>
<!--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using iTextSharp;
using iTextSharp.text.pdf;
using System.IO;
@hoangitk
hoangitk / Sample.vue
Created April 26, 2019 03:34 — forked from techlab23/Sample.vue
Vue Component
<template>
<div>
<h1> {{ message }} </h1>
<div
</template>
<script>
export default {
/* Child component registration */
components: {},
@hoangitk
hoangitk / Blobbed.cs
Created March 18, 2019 04:06 — forked from bariloce/Blobbed.cs
NHibernate, Fluent.NHibernate and PostgreSql: How to map PostgreSql Json type using Fluent.NHibernate
[Serializable]
public class Blobbed<T> : IUserType where T : class
{
public new bool Equals(object x, object y)
{
if (x == null && y == null)
return true;
if (x == null || y == null)
return false;
-- clean up database from previous test
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
-- create EAV tables
CREATE TABLE entity (
id SERIAL PRIMARY KEY,
name TEXT,
description TEXT
);