Skip to content

Instantly share code, notes, and snippets.

@hoangitk
hoangitk / Loot-ReadMe.md
Created February 27, 2019 07:46 — forked from mattmccray/Loot-ReadMe.md
Loot.js - Smart stores for Riot (like flux, based on ideas from RiotControl)

Loot.js!

Smart stores for Riot (like flux, based on ideas from RiotControl)

Small (<1.5Kb) flux-like store container.

Example

Make sure loot.js is included in your page after riot.js:

@hoangitk
hoangitk / blog-webpack-2.md
Created January 8, 2019 10:36 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@hoangitk
hoangitk / organization-by-concepts.md
Last active February 19, 2019 07:00 — forked from iagodahlem/organization-by-concepts.md
Vue: Project Organization by concepts

Vue: Project Organization by concepts

|-- src
|  |-- app
|  |  |-- user
|  |  |  |-- CreateUser.js
|  |  |-- article
|  |  |  |-- GetArticle.js
| |-- domain
@hoangitk
hoangitk / organization-by-features.md
Last active February 19, 2019 07:01 — forked from iagodahlem/organization-by-features.md
Vue: Project Orgnization by features

Vue: Project Organization by features

.
|-- src
|  |-- common
|  |  |-- infra
|  |  |  |-- httpService.js
|  |  |-- view
|  |  |  |-- Button.js
| | | |-- Input.js
@hoangitk
hoangitk / nginxproxy.md
Created December 19, 2018 04:30 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hoangitk
hoangitk / DmpAnalysis.linq
Created October 23, 2018 09:51 — forked from NickCraver/DmpAnalysis.linq
DMP Analysis in LinqPad
<Query Kind="Program">
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference>
<Namespace>Microsoft.Diagnostics.Runtime</Namespace>
<Namespace>System</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace>
</Query>
@hoangitk
hoangitk / FindInFiles.linq
Created October 23, 2018 09:29 — forked from daryllabar/FindInFiles.linq
LinqPad Find Text in File
void Main()
{
var searchWord = "TextToSearchFor";
var searchPattern = "*.js";
var sourceFolder = @"C:\_Dev\TFS\MyProject\Source\";
var defaultProgram = @"C:\Program Files (x86)\Notepad++\notepad++.exe";
List<string> allFiles = new List<string>();
var fileCount = 0;
@hoangitk
hoangitk / WP-Query
Created September 23, 2018 14:59 — forked from farrukhmomin/WP-Query
SQL Query to get Latest Wordpress Post with Featured Image.
select DISTINCT wp_posts.id, wp_posts.post_title, wp_posts.post_content, wp_posts.post_type, featured_image.guid as post_image, wp_posts.post_modified, wp_users.display_name
from wp_posts
inner join wp_postmeta on wp_posts.id = wp_postmeta.post_id and wp_postmeta.meta_key = '_thumbnail_id'
inner join wp_posts as featured_image on featured_image.id = wp_postmeta.meta_value
inner join wp_users on wp_users.id = wp_posts.post_author
where wp_posts.post_status = 'publish'
order by wp_posts.ID desc
limit 10
@hoangitk
hoangitk / Resources.tt
Created June 20, 2018 17:51 — forked from codingawayy/Resources.tt
T4 template to generate list of files that are part of the project. This template is useful for generating list of css/js resources to be put in bundle. The value comes from the fact that files which are not part of the project (e.g. - excluded files) will not actually be included in the resulting list.
// This is an auto-generated file.
<#@ template language="C#" hostSpecific="true" debug="True" #>
<#@ output extension="cs" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDte" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System" #>
@hoangitk
hoangitk / JunctionPoint.cs
Created June 7, 2018 08:22 — forked from LGM-AdrianHum/JunctionPoint.cs
Create, Delete and Examine Junction Points in C#
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;