Skip to content

Instantly share code, notes, and snippets.

@RyushiAok
RyushiAok / settings.json
Last active September 17, 2024 05:27
settings.json
{
// layout
"workbench.list.smoothScrolling": true,
"workbench.colorCustomizations": {},
"workbench.startupEditor": "none",
"workbench.activityBar.location": "top",
// editor
"editor.accessibilitySupport": "off",
"editor.lineNumbers": "relative",
@RyushiAok
RyushiAok / ddsk.fs
Last active August 6, 2024 15:41
F# DDSK
open System
open System.Collections.Generic
[<Literal>]
let DDSK = "ドドスコスコスコドドスコスコスコドドスコスコスコ"
let withLastNElements n (sq: seq<'T>) =
let mutable queue = Queue()
[*.{fs,fsx,fsi}]
max_line_length = 88
fsharp_max_infix_operator_expression = 60
fsharp_max_dot_get_expression = 60
fsharp_multiline_bracket_style = stroustrup
@RyushiAok
RyushiAok / keybindings.json
Last active September 1, 2024 08:02
vscode keybindings
[
//
// Copy, Select All
//
{
"key": "ctrl+c",
"command": "-vscode-neovim.escape",
"when": "editorTextFocus && neovim.ctrlKeysNormal.c && neovim.init && !dirtyDiffVisible && !findWidgetVisible && !inReferenceSearchEditor && !markersNavigationVisible && !notebookCellFocused && !notificationCenterVisible && !parameterHintsVisible && !referenceSearchVisible && neovim.mode == 'normal' && editorLangId not in 'neovim.editorLangIdExclusions'"
},
{
@RyushiAok
RyushiAok / 🐲2024.fsx
Created January 1, 2024 15:01
🐲2024.fsx
open System
open System.Threading
type Frame = string[]
type Animation = seq<Frame>
let mergeFrame (a: Frame) (b: Frame) : Frame =
Array.zip a b
|> Array.map (fun (a, b) ->
(a.ToCharArray(), b.ToCharArray())
@RyushiAok
RyushiAok / FsFizzBuzz.fsx
Created December 5, 2023 03:43
FsFizzBuzz.fsx
let (|Fizz|_|) n = if n % 3 = 0 then Some "Fizz" else None
let (|Buzz|_|) n = if n % 5 = 0 then Some "Buzz" else None
let (|FizzBuzz|_|) n =
if n % 15 = 0 then Some "FizzBuzz" else None
let fizzBuzz =
function
| FizzBuzz fizzbuzz -> fizzbuzz
| Fizz fizz -> fizz
@RyushiAok
RyushiAok / markdown.fs
Created October 18, 2023 15:03
F# Markdown Builder
type Block =
| H1 of string
| H2 of string
| P of string
type Markdown = {
title: string
author: string
blocks: Block list
} with
@RyushiAok
RyushiAok / fix_ml_pipline.fs
Last active October 15, 2023 12:35
fix_ml_pipline
// fix: https://gist.github.com/jkone27/de477e362f3ee9f36069c0010e0a1f29
open Microsoft.ML
open Microsoft.ML.Data
open FSharp.Data
[<Literal>]
let trainDataPath = __SOURCE_DIRECTORY__ + "/house-price-train.csv"
[<Literal>]
@RyushiAok
RyushiAok / unko_builder.fs
Created October 9, 2023 12:56
uncode💩
type NextChar = NextChar
type NextWidth = NextWidth of char
type NextHeight = NextHeight of char * int
type EndUnnko = EndUnnko of char * int * int
type UnnkoBuilder () =
member _.Yield(_: unit) = NextChar
member _.Run(EndUnnko (char, w, h): EndUnnko) =
let nChars n c = c |> Array.replicate n |> System.String
printfn "%s∫ ∫ ∫ " <| nChars h ' '
printfn "%sノヽ " <| nChars h ' '