Skip to content

Instantly share code, notes, and snippets.

View sliekens's full-sized avatar

Steven sliekens

View GitHub Profile
@sliekens
sliekens / compare-files.ps1
Last active July 12, 2018 08:39
Comparing git-ls-files to actual filenames
Compare-Object `
-ReferenceObject (git ls-files | Resolve-Path -Relative | Sort-Object) `
-DifferenceObject (Get-ChildItem -Recurse -File | Resolve-Path -Relative | Sort-Object) `
-CaseSensitive `
-SyncWindow 0
@sliekens
sliekens / eolconfig.ps1
Last active October 7, 2021 11:58
Configure Git line normalization the right way (using PowerShell)
# first install Git 2.16+
# https://git-scm.com/download/win
git --version
# (optional) reset machine settings because per-machine config makes no sense in team projects
# the default (when not set) for core.autocrlf is false (no eol conversions)
git config --unset core.autocrlf
git config --unset core.safecrlf
git config --unset core.eol
@sliekens
sliekens / ES6ModulesHttpModule.cs
Last active June 3, 2018 21:55
Make IIS support extension-less imports
public class ES6ModulesHttpModule : IHttpModule
{
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.BeginRequest += ContextOnBeginRequest;
}
export class Hero {
id: number;
name: string;
superpower: Power;
friends: Hero[];
}
export class Power {
name: string;
}
@sliekens
sliekens / Git_mergetool_commands
Created November 10, 2017 10:16 — forked from RohanBhanderi/Git_mergetool_commands
Git Mergetool and difftool with Beyond Compare 4
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@sliekens
sliekens / aliases.sh
Last active November 27, 2019 10:33
Useful Git aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.last "log -1 HEAD"
git config --global alias.ff "merge --ff-only"
git config --global alias.root "rev-parse --show-toplevel"
git config --global alias.done "branch --format=\"%(if:equals=gone)%(upstream:track,nobracket)%(then)%(refname:short)%(end)\""
git config --global alias.doing "branch --format=\"%(if:notequals=)%(upstream)%(then)%(refname:short)%(end)\""
git config --global alias.todo "branch --format=\"%(if:equals=)%(upstream)%(then)%(refname:short)%(end)\""
function getSequentialFocusNavigationOrder(nodeList) {
var els = Array.prototype.slice.call(nodeList);
els = els.filter(e => e.tabIndex !== -1);
els = els.filter(e => !e.disabled);
els = els.sort(function(left, right) {
if (left.tabIndex === 0) {
if (right.tabIndex === 0) {
return 0;
}
return 1;
using System;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Optimization;
[DebuggerStepThrough]
public static class BundleCollectionExtensions
{
public static void VerifyStyleBundles(this BundleCollection instance)
@sliekens
sliekens / FileDownloadBlock.cs
Created June 26, 2016 09:53
FileDownloadBlock
public class FileDownloadBlock : IPropagatorBlock<Uri, Stream>
{
private readonly IPropagatorBlock<Uri, Stream> impl = new TransformBlock<Uri, Stream>(new Func<Uri, Stream>(Implementation));
private static Stream Implementation(Uri uri)
{
throw new NotImplementedException();
}
public DataflowMessageStatus OfferMessage(