Skip to content

Instantly share code, notes, and snippets.

View hidegh's full-sized avatar

balazs HIDEGHETY hidegh

View GitHub Profile
@0i0
0i0 / gist:1519811
Created December 25, 2011 22:05
javascript snippets
function getCookie(key){
var regEx = new RegExp(key+"=([^;]*)","g");
return regEx.exec(document.cookie)[1]
}
String.prototype.format = function () {
var args = arguments;
return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (curlyBrack, index) {
return ((curlyBrack == "{{") ? "{" : ((curlyBrack == "}}") ? "}" : args[index]));
});
@georg-jung
georg-jung / ProcessAsyncHelper.cs
Last active December 30, 2023 02:14 — forked from AlexMAS/ProcessAsyncHelper.cs
Use https://github.com/Tyrrrz/CliWrap instead, the following code has some shortcomings
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
// based on https://gist.github.com/AlexMAS/276eed492bc989e13dcce7c78b9e179d
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> RunProcessAsync(string command, string arguments, int timeout)
{