This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⍝ This is in a workspace, default namespace | |
⍝ created by )Ed ○InvokeAplExpression | |
⍝ Then exported as a Microsoft .Net Assembly | |
⍝ With the Isolation Mode dropdown set to | |
⍝ 'Each assembly attempts to use local bridge and interpreter libraries' | |
⍝ pre-req: make a project folder e.g. "D:\m\" and copy file | |
⍝ System.Management.Automation.dll from the .Net GAC into it. | |
⍝ PS> Copy-Item -Path ([psobject].Assembly.Location) -Destination 'd:\m\' -Verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$keys = @{ | |
'1'='' ; '2'='[abc]'; '3'='[def]' ; | |
'4'='[ghi]' ; '5'='[jkl]'; '6'='[mno]' ; | |
'7'='[pqrs]'; '8'='[tuv]'; '9'='[wxyz]'; | |
} | |
$nums = '76937' | |
$pattern = foreach ($char in $nums.GetEnumerator()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((0>⊣)⌽((⊂↑),(⊂↓))) ⍝ 1. Let's Split | |
(⊢⊂⍨(128∘>∨191∘<)) ⍝ 2. Characters | |
{26⊥⎕A⍳⍵} ⍝ 3. Columns | |
{(0=400|⍵)∨(≠⌿0=4 100∘.|⍵)} ⍝ 4. Take a Leap | |
{⎕IO←0 ⋄ ⌽⍣(>/⍵)⊢(⌊/⍵)+⍳1+(⌈/-⌊/)⍵} ⍝ 5. Stepping | |
{⍵[⍒⍺=⍵]} ⍝ 6. Move To Front | |
{⍺=2⊥bits∧⍺⊤⍨2⍴⍨≢bits←2⊥⍣¯1⊢⍵} ⍝ 7. Bits | |
{(∨/(1 ¯1⍴⍨≢)⍷⍨(×2-/⊢))10⊥⍣¯1⊢⍵} ⍝ 8. Zigzag | |
{peak←(⊢⍳⌈/),⍵ ⋄ notDesc←(⍳∘≢≡⍋) ⋄ (notDesc peak↑⍵) ∧ (notDesc ⌽peak↓⍵)} ⍝ 9. Rise and fall | |
⍝ 10. Stacking It Up - not done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright: (c) 2020, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
Add-Type -Namespace PInvoke -Name NativeMethods -MemberDefinition @' | |
[DllImport("Kernel32.dll")] | |
public static extern bool CloseHandle( | |
IntPtr hObject); | |
[DllImport("Advapi32.dll", SetLastError = true)] | |
public static extern bool ImpersonateLoggedOnUser( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TIO Link verify helper for APLCart. | |
# Open this file in PowerShell ISE on Windows (or other Unicode-aware console, e.g. VS Code + PowerShell extension, new Windows Terminal; not basic PowerShell window) | |
# Update $tablePath to point to the table. | |
# Update the string of codes to find. | |
# Run. | |
$tablePath = "c:\sc\aplcart\table.tsv" | |
$codesToFind = @' | |
0∘×N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports the table.tsv file from APLCart | |
# Decodes the TIO.run links | |
# Shows in Out-Gridview | |
$tablePath = "c:\sc\aplcart\table.tsv" | |
$csharp = @' | |
using System; | |
using System.IO; | |
using System.Net; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tioCode←{ | |
⍝ decodes a TIO.run link such as | |
⍝ tioCode 'https://tio.run/##SyzI0U2pTMzJT////1Hf1EdtExSMFYwf9W551LvZkgsioq4OZSg86lzwqHcFkor//wE' | |
⍝ load dfns workspace to use base64 decoder | |
_←{(⍎⍵ ⎕NS ⍬).⎕CY ⍵}'dfns' | |
⎕USING←'System' 'System.Net,System.dll' | |
hash←('^https://tio\.run/##'⎕R'')⍵ ⍝ remove web address parts of the link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#source of the main script : "https://gist.github.com/indented-automation/32efb05a5fb67ef9eed02bbb8fe90691" | |
#source of the Regex filtering : "https://github.com/gangstanthony/PowerShell/blob/master/Get-InstalledApps.ps1" | |
filter Get-InstalledSoftware { | |
<# | |
.SYNOPSIS | |
Get all installed from the Uninstall keys in the registry. | |
.DESCRIPTION | |
Read a list of installed software from each Uninstall key. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace System.Collections.Generic | |
using namespace System.Management.Automation | |
using namespace System.Security.AccessControl | |
using namespace Microsoft.Win32 | |
function Get-InstalledSoftware { | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline)] | |
[ValidateNotNullOrEmpty()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
fn main() { | |
// vector of prime "hashes", sorted so they can be binary searched | |
let lookup_primes : Vec<i64> = vec![11794860,11846142,12512808,15655440,16956360,18137400,18346020,21651280,22123600,25956240,29902200,31549560,40300260,42095196,42597520,44697576,45014200,46852656,49206300,51447780,52811220,65410224,71180340,71722280,80102484,80854620,86665840,87931500,93458568,99722800,100683660,103230666,103799850,105129432,108746484,109035300,111985020,113384502,119599788,124081320,125368650,129507400,130227900,136800600,137434220,140220850,150346392,151367370,155189100,156605460,156632322,164712900,172051110,174106200,180333560,181234350,182071890,188839860,191423100,194597480,196068180,197110452,198917950,204831408,209420750,211333276,211967376,214322280,217467684,220101420,220101420,220644468,228171720,234393720,238368300,239007760,245070980,246202440,246705690,248471300,253137720,257298888,257397140,264279246,264964968,265756260,268660700,272580924,280854420,282643740,291984660,29201 |