Skip to content

Instantly share code, notes, and snippets.

View yumura's full-sized avatar

yumura_s yumura

View GitHub Profile
@yumura
yumura / poco.psm1
Last active October 15, 2024 21:50
powershell peco
# Load
Split-Path $MyInvocation.MyCommand.Path -Parent | Push-Location
Get-ChildItem poco_*.ps1 | %{. $_}
Pop-Location
function Select-Poco
{
Param
(
[Object[]]$Property = $null,
@yumura
yumura / fnparse.Ex.Tests.ps1
Last active August 6, 2016 01:47
PowerShell で数式パーサーを書きたかった...
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Ex.Tests.", ".")
. "$here\$sut"
function json
{
Begin {$w = @()}
Process {$w += ,$_}
@yumura
yumura / ConvertFrom-Pomp.Converter.Tests.ps1
Last active September 2, 2016 05:58
Convert-FromPOMP
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Converter.Tests.", ".")
$ConvertFromPomp = "$here\$sut"
Set-StrictMode -Version Latest
Describe "No Conversion" {
It Table {
$inJson = '{"Array":[{}]}'
$inPomp = @"
@yumura
yumura / Write-LINE.ps1
Last active August 16, 2018 00:39
PowerShell から IFTTT 経由で LINE Notify
[CmdletBinding()]
Param
(
[ValidateNotNullOrEmpty()]
[string] $Title = "",
[parameter(ValueFromPipeline=$true)]
$Value,
[string] $PhotoURL,
@yumura
yumura / Lambda.Tests.ps1
Last active May 11, 2020 15:33
Lambda calculus :: PowerShell
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' -replace '\.ps1', '.psm1'
Import-Module "$here\$sut" -Force
Describe "Church Numerals" {
$cSucc = \ n f x . f (\ n f x)
$cPlus = \ m n . n $cSucc m
$cMult = \ m n f . m (\ n f)
$cExp = \ m n f x . (\ n m) f x
$cPred = \ n f x . n (\ g h . h (\ g f)) (\ u . x) (\ u . u)