These files are part of how I build a powershell profile.
This is what it looks like at startup:
I suggest that you create one or more Api.fs
files to expose F# code in a C# friendly way.
In this file:
PascalCase
names. They will appear to C# as static methods.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
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.
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.
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.
#!/bin/sh | |
# Benjamin Collins <[email protected]> | |
# 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" |
// 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 ) |
[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 |
// select (LINQ Syntax) | |
var regions = | |
from r in Regions | |
where r.RegionID > 0 | |
select r; | |
regions.Dump(); | |
// insert | |
Region newRegion = new Region(){ | |
RegionID = 99, |
#!/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 |