Skip to content

Instantly share code, notes, and snippets.

View aggieben's full-sized avatar
🏠
Working from home

Ben Collins aggieben

🏠
Working from home
View GitHub Profile
@aggieben
aggieben / 00_powershell_profile_readme.md
Last active July 14, 2020 13:56
PowerShell Profile Scripts

Overview

These files are part of how I build a powershell profile.

This is what it looks like at startup:

Terminal Startup

Setup Instructions

@notheotherben
notheotherben / README.md
Last active December 28, 2022 14:06
PowerShell Configuration

PowerShell Configuration

To setup your PowerShell to match mine, simply run the following commands:

# You may need to run this in an administrative PowerShell instance
Set-ExecutionPolicy Unrestricted

$SetupScript = Invoke-WebRequest https://gist.githubusercontent.com/notheotherben/77ccb460948afd826365e85d226509a7/raw/setup.ps1
$ScriptBlock = [ScriptBlock]::Create($SetupScript.Content)
Invoke-Command -ScriptBlock $ScriptBlock
@raorao
raorao / pr-comment-emojis.md
Last active March 27, 2024 23:21
PR Comment Emojis

Any top-level comment on pull request ought be tagged with one of four emojis:

  • for a non-blocking comment that asks for clarification. The pull request author must answer the question before the pull request is merged, but does not have to wait for the comment author to re-review before merging.

  • 🎨 for a non-blocking comment that proposes a refactor or cleanup. The pull request author does not have to address the comment for the pull request to merge.

  • ⚠️ for a blocking comment that must be addressed before the pull request can merge. The comment's author should leave a Request Changes review, and is responsible for re-reviewing once the pull request author has addressed the issue.

  • 😻 for a comment that compliments the author for their work.

@DustinCampbell
DustinCampbell / using-msbuildworkspace.md
Created April 10, 2018 21:36
Using MSBuildWorkspace

Introduction

Roslyn provides a rich set of APIs for analyzing C# and Visual Basic source code, but constructing a context in which to perform analysis can be challenging. For simple tasks, creating a Compilation populated with SyntaxTrees, MetadataReferences and a handful of options may suffice. However, if there are multiple projects involved in the analysis, it is more complicated because multiple Compilations need to be created with references between them.

To simplify the construction process. Roslyn provides the Workspace API, which can be used to model solutions, projects and documents. The Workspace API performs all of the heavy lifting needed to parse SyntaxTrees from source code, load MetadataReferences, and construct Compilations and add references between them.

@aggieben
aggieben / dotnet-versions
Last active July 20, 2017 21:52
List installed .NET Core SDK versions
#!/bin/sh
# Benjamin Collins <aggieben@gmail.com>
# Requires GNU readlink (get on macOS with `brew install coreutils`)
READLINK=${READLINK:-readlink}
cliPath=$(which dotnet)
netDir=$(dirname $($READLINK -f $cliPath))
ls -1 "$netDir/sdk"
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@BenWhitehead
BenWhitehead / teamcity-agent.service
Created March 7, 2014 23:09
systemd service files for running TeamCity (create in /usr/lib/systemd/system)
[Unit]
Description=TeamCity Build Agent
After=network.target
[Service]
Type=forking
PIDFile=$AGENT_HOME/logs/buildAgent.pid
ExecStart=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh start
ExecStop=/usr/bin/sudo -u teamcity $AGENT_HOME/bin/agent.sh stop
@troygoode
troygoode / LINQPad.cs
Created November 2, 2012 02:07
Add/Update/Delete With LINQPad
// select (LINQ Syntax)
var regions =
from r in Regions
where r.RegionID > 0
select r;
regions.Dump();
// insert
Region newRegion = new Region(){
RegionID = 99,
@KylePDavis
KylePDavis / sh_env_var_opts.sh
Last active September 14, 2023 01:26
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
@jpoehls
jpoehls / encoding-helpers.ps1
Created April 17, 2012 14:54
Convert-FileEncoding and Get-FileEncoding
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0