Skip to content

Instantly share code, notes, and snippets.

View rosdi's full-sized avatar
🥴

Rosdi Kasim rosdi

🥴
  • Malaysia
View GitHub Profile
@tjrobinson
tjrobinson / gist:0ad6c790e90d7a385eb1
Last active July 12, 2018 02:55
ActiveDirectoryUserService.cs
using System;
using System.Collections.Generic;
using System.DirectoryServices.AccountManagement;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Models;
using Thinktecture.IdentityServer.Core.Services;
@DamianReeves
DamianReeves / .gitconfig
Created April 18, 2015 01:44
Using Visual Studio AS Git Merge Tool
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
keepbackup = false
trustexistcode = true
[merge]
tool = vsdiffmerge
@edward-hsu-1994
edward-hsu-1994 / async.ts
Created July 10, 2016 16:08
Typescript Async/Await Sample
async function get(url) : Promise<string> {
return new Promise<string>((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function (event) {
if (xhr.readyState !== 4) return;
if (xhr.status >= 200 && xhr.status < 300) {
resolve(xhr.responseText);//OK
} else {
reject(xhr.statusText);//Error