Skip to content

Instantly share code, notes, and snippets.

View nordinrahman's full-sized avatar

Nordin Rahman nordinrahman

View GitHub Profile
@nordinrahman
nordinrahman / ConstructQueryStringDictionary.vb
Last active July 25, 2017 08:01
Create Dictionary from query string
' Make dictionary object containing query string key name based on specified query string
function ConstructQueryStringDictionary(queryString)
Dim d
Set d = Server.CreateObject("Scripting.Dictionary")
dim keyValues
keyValues = Split(queryString, "&", -1, 1)
For Each keyValue In keyValues
dim keyName, value, lenKeyValue
@nordinrahman
nordinrahman / HasParamQ
Created February 24, 2014 06:45
Determine if specify query string key exist in specified query string
' -----------------------------------------
' Determine if specify query string key exist in specified query string
' -----------------------------------------
Function HasParamQ(key, queryString)
dim result
result = False
dim kvs
kvs = Split(queryString, "&", -1, 1)
For Each kv in kvs
@nordinrahman
nordinrahman / URLDecode
Created February 24, 2014 06:46
ASP code to URL-decode a query string
' -----------------------------------------
' URL decode to retrieve the original value
' -----------------------------------------
Function URLDecode(sConvert)
Dim aSplit
Dim sOutput
Dim I
If IsNull(sConvert) Then
URLDecode = ""
Exit Function
@nordinrahman
nordinrahman / VsixManifest.cs
Created April 18, 2014 11:00
Vsix Manifest File Wrapper
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
namespace Company.Product
{
public class VsixManifest
{
@nordinrahman
nordinrahman / keybase.md
Created May 10, 2015 08:06
Keybase proof

-----BEGIN PGP MESSAGE----- Version: GnuPG v2

owFtkntQFVUcx3mEoSRCQJFhyZogcbnu4+yLGQ2azBAnKAJURi57ds9yN2Ev3Feg IRTjIBihoDY0mGO3GiweMQVRToETg4YGM4QvbmOhWSAmSGgqem0XbdKZzl/n8fl9 f7/v+f12zvf18vd+4WZW6Byf85nex8agV3pK0F9bMGiRirH4LZiYpyDVru9UIR9h 8dgmVAwFGzIqlsWqRULG122L7zEGzImsNsWiahRuZI0cVmLQcT1YVtRcZC2wKroW BiCJJAFyosQigpYYCVA8pJEEgCzQkAA4g5OIollN0myx2R/Iis1qmhRJ1wEvJtLP 3+VX3eUdsw8kADjiAIfLpMxyrCgCgec5AoiCREg8weugDVnvWVItVklR9WrzkXVT HjJZLZZZy6Jd0QECUISmyDOMVo9gM2shkCBlkkAk4HFWhDhHSyQFgQgBDSiZJkVC

@nordinrahman
nordinrahman / escapeHtml.js
Created August 27, 2015 07:56
escapeHtml via JavaScript
// http://stackoverflow.com/a/13371349/29669
var escapeHtml = (function () {
'use strict';
var chr = { '"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;' };
return function (text) {
return text.replace(/[\"&<>]/g, function (a) { return chr[a]; });
};
}());
@nordinrahman
nordinrahman / KendoUIRecipes.js
Created August 27, 2015 08:50
Kendo UI Related Recipes
// to get view model from a binded element (can be sub element too)
$("#elementId").get(0).kendoBindingTarget.source
@nordinrahman
nordinrahman / UnrestrictPowershell.ps1
Created March 7, 2016 01:46
Unrestrict powershell scripts
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
@nordinrahman
nordinrahman / PadStringToTheRightOfChar.sql
Created July 28, 2016 06:01
Set string to the right of the char variable in SQL
DECLARE @COUNTER INT = 0;
DECLARE @PADDEDCOUNTER NCHAR(6)
WHILE @COUNTER < 100000
BEGIN
SET @COUNTER = @COUNTER + 1
DECLARE @COUNTERSTRING NVARCHAR(6) = CAST(@COUNTER AS NVARCHAR(6));
SET @PADDEDCOUNTER = REPLICATE(N' ', 6-LEN(@COUNTERSTRING)) + @COUNTERSTRING
@nordinrahman
nordinrahman / CustomeCultureInfo.cs
Created September 18, 2016 10:06
Custom CultureInfo class, to be used, when instantiation of CultureInfo trigger CultureNotFoundException. Only support locale-name with format xx-XX.
using System.Globalization;
using System.Text.RegularExpressions;
namespace CustomeCultureInfo
{
/// <summary>
/// Custom culture info
/// </summary>
public class CustomCultureInfo : CultureInfo
{