Skip to content

Instantly share code, notes, and snippets.

View blyry's full-sized avatar

blyry

View GitHub Profile
get_latest_github_release() {
local repo="$1"
# Check the time and tag of the last update from the dotfile
local dotfile="$HOME/.github_release_check_times"
local last_check_time
local last_tag
if [[ -f "$dotfile" ]]; then
last_check_time=$(grep "${repo}_time" "$dotfile" | cut -d '=' -f 2)
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adPDCVMName": {
"type": "string"
},
"adAvailabilitySetName": {
"type": "string"
},
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adPDCVMName": {
"type": "string"
},
"adAvailabilitySetName": {
"type": "string"
},
@blyry
blyry / Routes.cs
Created January 14, 2016 23:40
first stab at automatically generating wcf ServiceContracts and OperationCOntracts.
/*
I think the next best way to go is to investigate hooking into ninject
and ninject.dynamicproxy to dynamically add the attributes to a proxy class that we hand off to wcf.
We can't just make our own dynamic proxy because we lose the dependency injection on the instance that ninject already gave us
BUT maybe if there's a dynamic proxy that just wraps the instance it was already given?
class myclass {
public foo() {}
}
@blyry
blyry / vmDev
Created December 21, 2015 15:59
Enable-RemoteDesktop
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
cinst IIS-WebServerRole -source windowsfeatures
cinst lastpass
cinst putty
cinst putty.install
cinst everything
cinst winrar
@blyry
blyry / dexServerChoco.ps1
Last active August 29, 2015 14:19
index server
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
CINST Boxstarter
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
cinst git
cinst git.install
cinst tortoisegit
cinst notepadplusplus
cinst notepadplusplus.install
cinst winmerge
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
cinst jre8
cinst dotnet3.5
cinst DotNet4.5
cinst eazfuscator.net
cinst firefox
cinst putty
cinst putty.install
cinst winrar
Enable-RemoteDesktop
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
cinst IIS-WebServerRole -source windowsfeatures
cinst smtp4dev
cinst eazfuscator.net
cinst firefox
cinst googlechrome
cinst lastpass
@blyry
blyry / PropertySizeComparer.cs
Last active January 2, 2016 18:19
IComparer for our app - it compares shirt sizes, with overloads for a couple of DTOs.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Cubrd.Services.DTOs;
namespace Cubrd.Services.Utility
{
@blyry
blyry / sortbymixin.coffee
Created January 29, 2013 17:30
_.js mixin for string sorting.
#a fancy sorting function
sortWithComparisonMod = (obj, value, context, comparisonFunc) ->
#context and comparisonFunc are optional. if comparisonFunc is null and context is a function, then they've
#given us comparisonFunc in the second index
if _.isFunction(context) && not comparisonFunc? then (comparisonFunc = context;context = obj)
#if they didn't specify a comparisonFunc then they should just use the regular _.sortBy
if not comparisonFunc? then return _.sortBy(obj,value,context)
#normalize the iterator
iterator = if _.isFunction(value) then value else (obj) -> obj[value]
#rest of the sort function, this is kindof like how .NET does lambda closures! neato. From _.js 1.4.2