This file contains 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
// dump the directory structure that exists from cwd and down. ignoring most files | |
open System | |
let indentAmount = 2 | |
let dirIndent = "-" | |
let fileIndent = "+" | |
let interestingFiles = [ ".xml"; ".nupkg" ] | |
let blacklist = [ "bin"; "obj"; "packages"; "runtimes" ] |
This file contains 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
// searching from a directory inside all files matching a regex, for text matching a regex, returning the files that have a match | |
// my own grep! | |
// via: https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/#grep | |
// gist: https://gist.github.com/swlaschin/137c322b5a46b97cc8be | |
let debug = false | |
// case insensitive? | |
let wordPattern = """dump""" | |
let (|ValueString|_|) x = |
This file contains 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
// level 58 test | |
// expected hit 3267; calc 3265 | |
// expected crit 10,633; calc 10626 | |
// expected pc 8821; calc 8815 | |
// expected crit pc 28,710; calc 28691 | |
type Crit = private { critc: decimal } with | |
static member ValidateCritRate crit = | |
if crit<0.0m || crit > 1.0m then Error () |
This file contains 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
<# | |
SEND Text just types out the text in the input to send over rdp where copy and paste is not enabled. | |
1. put the text you want to send as the $input variable | |
2. set timeout (optional) to the number of seconds you want to wait until it starts to send | |
3. Start script | |
4. before the timeout is complete, put the mouse focus on the window you want input the text to | |
RDP -> Notepad on remote system | |
5. Wait for the text to fully send. Depending on how long the string is, it could take a while. |
This file contains 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
{ | |
"name": "my-app", | |
"version": "0.1.0", | |
"private": true, | |
"engines": { | |
"node": ">17" | |
}, | |
"dependencies": { | |
"@azure/msal-browser": "^2.38.1", | |
"@azure/msal-react": "^1.5.10", |
This file contains 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
// walk two sets of data remove overlap | |
let toLower (x:string) = x.ToLowerInvariant() | |
let afterLast (delimiter:string) (value:string) = | |
value[value.LastIndexOf(delimiter) + 1 ..] | |
let photos = File.ReadAllLines(@"C:\Users\B\Documents\lancephotos.csv") |> Array.skip 2 |> Array.map (fun v -> v.Trim '"' |> toLower) |> Array.truncate 1_000 | |
let students = File.ReadAllLines(@"C:\Users\B\Documents\lancestudents.csv") |> Array.skip 2 |> Array.map (fun v -> v.Trim '"' |> toLower |> afterLast "\\") // |> Array.truncate 5 | |
//(photos,students).Dump() |
This file contains 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
// target a paket.lock and generate a nuget packages.config | |
// may have to mate paket.lock with specific project files(paket.references), or generate a dummy project file | |
// consider paket.dependencies ? | |
// #r Paket.Core 7.2.1 | |
let targetSlnRoot = @"C:\projects\safe" | |
// let lockFile = Path.Combine(targetSlnRoot, "paket.lock") | |
let depFile = Path.Combine(targetSlnRoot, "paket.dependencies") | |
let getPackageInfo (dep:Paket.Dependencies) = | |
let lfData = dep.GetLockFile() |
This file contains 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
// clone project structure/some files | |
let src = @"C:\projects\YourProject\" | |
// assuming existing folder | |
let target = @"C:\projects\ReproFolder" | |
let wipeTarget = true | |
if wipeTarget then | |
// assumes deleting the dir and recreating it won't blow away permissions | |
if Directory.Exists target then | |
Directory.Delete(target,true) | |
Directory.CreateDirectory target |> ignore |
This file contains 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
let getCidTotal = (cid) => | |
cid.map(x => x[1]).reduce((x,y) => x + y); | |
function payout(owed,dv,v){ | |
// if we have less than a d, or we owe less than a d skip | |
if(dv === 0.01) | |
console.log(JSON.stringify({owed,dv,v})); | |
if(v < dv || owed < dv) return; | |
var i = 0; |
This file contains 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
// let devroot = Environment.ExpandEnvironmentVariables("%devroot%") | |
let debug = true | |
module Option = | |
let ofNullOrEmpty = | |
function | |
| null -> None | |
| "" -> None | |
| x -> Some x |
NewerOlder