Skip to content

Instantly share code, notes, and snippets.

View empitegayan's full-sized avatar
:octocat:
Focusing

Gayan Ranasinghe empitegayan

:octocat:
Focusing
View GitHub Profile
@empitegayan
empitegayan / 0_reuse_code.js
Created September 12, 2017 08:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@empitegayan
empitegayan / UploadImageWebApi.cs
Created October 8, 2018 04:18
Upload file asp.net web api
[Route("user/PostUserImage")]
public async Task<HttpResponseMessage> PostUserImage()
{
Dictionary<string, object> dict = new Dictionary<string, object>();
try
{
var httpRequest = HttpContext.Current.Request;
foreach (string file in httpRequest.Files)
@empitegayan
empitegayan / RemoveComment
Created March 28, 2019 07:18
remove commets and regions
/*** COMMENT REMOVE ***/
\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$
/*** REGION REMOVE ***/
^[ \t]*\#[ \t]*(region|endregion).*\n