Skip to content

Instantly share code, notes, and snippets.

@alanstevens
alanstevens / RunTests.cmd
Last active November 13, 2019 22:38
RunTests.cmd
@echo off
setlocal enableextensions
set SCRIPT=%0
set DQUOTE="
set OLDDIR=%CD%
set start=%time%
:: Detect how script was launched
@echo %SCRIPT:~0,1% | findstr /l %DQUOTE% > NUL
@alanstevens
alanstevens / standard.md
Last active October 8, 2018 03:29
Proposed C# Coding Standard

Proposed C# Coding Standard

Naming

  • Method, property and class names are PascalCased (as opposed to camelCase, snake_case or kebob-case)
  • Local variables and parameters are camelCased
  • Private fields start with an underscore and are _camelCase.
  • Classes, methods and variable names should have meaningful English names using whole words where it makes sense.
  • Avoid unnecessary contractions in your names. e.g. "Product" instead "Prod"
  • Give your DTOs meaningful English names. DO NOT rename any properties on a DTO. They are necessary for mapping to the stored procedure.
  • When converting FoxPro code do not automatically use the existing variable and function names.
  • Avoid Hungarian Notation (https://en.wikipedia.org/wiki/Hungarian_notation).
@alanstevens
alanstevens / install_dotnet_2.1.sh
Last active June 29, 2018 00:34
Script to install dotnet core sdk 2.1 on Ubuntu platforms. Run it with sudo and you'll be golden.
#!/bin/sh
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.1
@alanstevens
alanstevens / Ubuntu_MATE_Setup.md
Last active November 18, 2021 11:40
Setup guide for Ubuntu MATE

This guide was created using Ubuntu MATE

  • Release 18.04 LTS (Bionic Beaver) 64-bit
  • Kernel Linux 4.15.0-22-generic x86_64
  • MATE 1.20.1

Installation

Downloads:

@alanstevens
alanstevens / cloudSettings
Last active June 13, 2018 15:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-06-13T15:12:34.579Z","extensionVersion":"v2.9.2"}
@alanstevens
alanstevens / ConEmu.xml
Last active December 17, 2021 07:19
Windows 10 setup resource files
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2021-10-09 20:14:18" build="210912">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::PowerShell}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@alanstevens
alanstevens / Windows11_Setup.md
Last active October 3, 2024 14:12
Windows 11 Setup

This guide was created using Microsoft Windows 11 Pro

Version 21H2 build 22000.194

Installation

System Updates:

  • Settings -> Windows Update
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
@alanstevens
alanstevens / macOS_Setup.md
Last active December 17, 2021 07:16
macOS Setup and Configuration

This guide was created using macOS Big Sur 11.6

Installation:


For your sanity, do this first

  • System Preferences -> Trackpad -> Tap to click

Install Homebrew

Follow the instructions here

@alanstevens
alanstevens / create_gather_list.rb
Last active July 20, 2017 23:13
Gather song list by decade
#!/Users/Alan/.rbenv/shims/ruby -w
output = ""
artists ||= []
tracks ||= []
File.open( File.expand_path(File.dirname(__FILE__), 'all.txt' ) ).each do |line|
tracks << line
artist = line.split(" - ")[1]
artists << artist
end
@alanstevens
alanstevens / arrange_90s.rb
Last active November 5, 2016 23:17
I am collecting a 90s playlist. I gathered the tracks manually and put them in the file input.txt. Next, I wrote a ruby script to sort and group the data in a way that I could use to quickly gather the files I need to finish my playlist. I output my results to the console and to the file output.txt.
#!/Users/Alan/.rbenv/shims/ruby -w
output = ""
artists ||= []
tracks ||= []
File.open( File.expand_path(File.dirname(__FILE__), 'all.txt' ) ).each do |line|
tracks << line
artist = line.split(" - ")[1]
artists << artist
end