Skip to content

Instantly share code, notes, and snippets.

View stephensmitchell's full-sized avatar
🎯
Focusing

Stephen S. Mitchell stephensmitchell

🎯
Focusing
View GitHub Profile
@dingzeyuli
dingzeyuli / check_github_repo_size
Created December 16, 2016 22:34
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
@AlexMAS
AlexMAS / ProcessAsyncHelper.cs
Last active September 30, 2024 04:25
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
{
var result = new ProcessResult();
@meklarian
meklarian / string-set-vs-set.cs
Created December 1, 2010 21:04
LINQPad snippet that declares two string arrays, spits out their mutually exclusive parts.
var set1 = new string[]{"a","b","c","d"};
var set2 = new string[]{"a","e","i","o","u"};
var q = set1.Except(set2);
Console.WriteLine(q.Count());
Console.WriteLine("");
foreach(string s in q)
{
Console.WriteLine(s);