Skip to content

Instantly share code, notes, and snippets.


This is the diff of a change: GitHub diff

This is how it looks like after Expand-Diff on comparing "a" and "b":


View ForEach-Parallel-vs-Split-Pipeline.ps1
# ForEach-Object -Parallel is not suitable for many input objects with
# relatively fast processing. Split-Pipeline is very suitable for this.
#requires -version 7.0
$1 = {
$data | Split-Pipeline {process{ }} -Count $n
nightroman /
Created January 16, 2020 15:51 — forked from atenni/
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.


To return the first file from a gist:[gist_user]/[gist_id]/raw/

To get a file from multi–file gist:[gist_user]/[gist_id]/raw/[file_name]

nightroman / github-pandoc.css
Last active January 16, 2020 15:48 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
View github-pandoc.css
/*! normalize.css v2.1.3 | MIT License | */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
* Correct `block` display not defined in IE 8/9.
nightroman / Search my
Created January 7, 2020 18:49 — forked from santisbon/Search my
How to search gists
View Search my

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.

Find all gists with a .yml extension.

Find all gists with HTML files.


How to make a gist with images in the same gist

Right aligned

Usual picture


View InterfaceVsRecord.fsx
// F# call via interface vs. record
type IFace =
abstract Test: int -> string -> unit
type IRecord = {
Test: int -> string -> unit
let myTest i s =
nightroman /
Last active July 14, 2017 17:50
Turtle 16: Batch processing using command objects with responses

16: Batch processing using command objects with responses

The description is the same as the case 9 with the last disadvantage resolved. Namely

  • Only suitable when control flow is not based on the response from a previous command.
    • Case 16 solves this issue, commands have responses.

Below is the case 9 notes:

nightroman / Microsoft.VSCode_profile.ps1
Created May 19, 2017 14:59
My Microsoft.VSCode_profile.ps1
View Microsoft.VSCode_profile.ps1
function prompt
#! now: last error for the color
$color = if ($?) { 10 } else { 12 }
# debug
if ($ExecutionContext.SessionState.PSVariable.GetValue('PSDebugContext')) {
View steps.fsx
// sequence of steps
type Step =
| Next
| Ask1 of string ref
| Ask2 of string ref
let steps = seq {
printfn "step 0"