This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/Manuel-S/6db8b12835a71d9baf146af2964ee1c8/raw/')) | |
#install chocolatey if it isn't here already | |
if ((Get-Command "choco.exe" -ErrorAction SilentlyContinue) -eq $null) | |
{ | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
#install tex backend | |
cinst miktex -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace Consul | |
{ | |
public partial class ConsulService : IDisposable | |
{ | |
private string serviceId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adds a jquery plugin function to apply ko bindings to a jquery DOM set | |
$.fn.applyBindings = function (viewModel) { | |
return this.each(function () { | |
ko.applyBindings(viewModel, this); | |
}); | |
} | |
$.fn.koClean = function () { | |
return this.each(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
//nested array source | |
var source = new object[]{new object[]{1, 2, new[]{3}}, 4}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
public static partial class LinqExtensions | |
{ | |
public static IEnumerable<T> WhereProperties<T, P>(this IEnumerable<T> query, Func<IEnumerable<P>, bool> pred) | |
=> query.Where(item => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {bindable, noView, inject} from 'aurelia-framework'; | |
/* USAGE | |
<content-control content.bind="domElement"></content-control> | |
*/ | |
@noView | |
@inject(Element) | |
export class ContentControl{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {bindable, inject, inlineView} from 'aurelia-framework'; | |
import * as Awe from 'awesomplete'; //eslint-disable-line | |
/* USAGE: | |
<auto-complete | |
data.two-way="values" | |
selected.bind="selectedValue" | |
placeholder="Select a value" | |
label="Autocomplete"> | |
</auto-complete> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//reference iTunesLib from COM | |
using iTunesLib; | |
using Microsoft.Win32; | |
using System; | |
using System.IO; | |
using System.Threading; | |
using System.Linq; | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir %temp%\removefolder | |
robocopy %temp%\removefolder %1 /MIR | |
rmdir %1 | |
rmdir %temp%\removefolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
DoStuff() | |
} | |
catch (ArgumentException 💩) | |
{ | |
Console.WriteLine(💩.Message); | |
} | |
catch (Exception ಠ_ಠ) | |
{ |