Skip to content

Instantly share code, notes, and snippets.

View wjkhappy14's full-sized avatar
🎯
Focusing

AngkorW wjkhappy14

🎯
Focusing
View GitHub Profile
@wjkhappy14
wjkhappy14 / nginx-restart.bat
Created May 8, 2019 07:23
Quick startup for NGINX and PHP on Windows
@ECHO OFF
call nginx-stop.bat
call nginx-start.bat
EXIT /b
@wjkhappy14
wjkhappy14 / gist:7efc10385b9612b2a4cb62378a265dbd
Created September 6, 2018 04:30 — forked from leggetter/gist:769688
How to get the body of a HTTP Request using C#
private string GetDocumentContents(System.Web.HttpRequestBase Request)
{
string documentContents;
using (Stream receiveStream = Request.InputStream)
{
using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8))
{
documentContents = readStream.ReadToEnd();
}
}
@wjkhappy14
wjkhappy14 / keyboardlistener.cs
Created July 26, 2018 03:42 — forked from Ciantic/keyboardlistener.cs
C# Keyboard listener
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using System.Windows.Threading;
using System.Collections.Generic;
namespace Ownskit.Utils
{
/*
https://connect.microsoft.com/SQLServer/feedback/details/683411
*/
IF NOT EXISTS ( SELECT TOP 1 NULL
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'SinglePrimaryKey' )
BEGIN
CREATE TABLE SinglePrimaryKey
(
@wjkhappy14
wjkhappy14 / XE_Dynamic_Shred__LongRunningQueries
Created March 27, 2017 06:27 — forked from mbourgon/XE_Dynamic_Shred__LongRunningQueries
Using Extended Events to find long-running queries, with a dynamic XML shred and PIVOT to simplify the code
--written by MDB and ALM for TheBakingDBA.Blogspot.Com
-- basic XE session creation written by Pinal Dave
-- http://blog.sqlauthority.com/2010/03/29/sql-server-introduction-to-extended-events-finding-long-running-queries/
-- mdb 2015/03/13 1.1 - added a query to the ring buffer's header to get # of events run, more comments
-- mdb 2015/03/13 1.2 - added model_end events, filtering on hostname, using TRACK_CAUSALITY, and multiple events
-- mdb 2015/03/18 1.3 - changed header parse to dynamic, courtesy of Mikael Eriksson on StackOverflow
-- This runs on at 2008++ (tested on 2008, 2008R2, 2012, and 2014). Because of that, no NOT LIKE exclusion
------------------------------
-- Create the Event Session --
------------------------------
@wjkhappy14
wjkhappy14 / RxJS 5 Operators By Example.md
Created December 12, 2016 03:10 — forked from lyyourc/RxJS 5 Operators By Example.md
「译」RxJS 5 Operators By Example
@wjkhappy14
wjkhappy14 / rxjs_operators_by_example.md
Created December 12, 2016 03:10 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example