Skip to content

Instantly share code, notes, and snippets.

View NateLehman's full-sized avatar

Nate Lehman NateLehman

  • Brooklyn NY
View GitHub Profile
@NateLehman
NateLehman / AllInOne.ps1
Last active July 29, 2020 12:48
F# PowerShell Module Scaffold
dotnet new sln -o DotnetCoreProj
cd DotnetCoreProj
dotnet new classlib -lang 'F#' -o src/MyPSModule
dotnet sln add src/MyPSModule/MyPSModule.fsproj
cd src/MyPSModule
dotnet add package PowerShellStandard.Library
@'
namespace MyPSModule
open System.Management.Automation
using System.Management.Automation;
namespace MyPSModule
{
[Cmdlet("Get", "Foo")]
public class GetFooCommand : PSCmdlet
{
[Parameter]
public string Name { get; set; } = string.Empty;
namespace MyPSModule
open System.Management.Automation
[<Cmdlet("Get", "Foo")>]
type GetFooCommand () =
inherit PSCmdlet ()
[<Parameter>]
member val Name : string = "" with get, set
@NateLehman
NateLehman / pbcopy.fish
Last active November 28, 2018 22:33
fish alias commands for copy and paste to system clipboard on WSL (flavored like osx)
function pbcopy --description 'alias pbcopy /mnt/c/windows/system32/clip.exe'
/mnt/c/windows/system32/clip.exe $argv;
end
@NateLehman
NateLehman / fish_prompt.fish
Created November 28, 2018 22:17
my fish prompt the way I like it :^)
function fish_prompt --description 'Write out the prompt'
set -l color_cwd
set -l suffix
switch "$USER"
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
@NateLehman
NateLehman / .hyper.js
Last active February 22, 2018 09:24
my `.hyper.js` configuration
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',