Skip to content

Instantly share code, notes, and snippets.

@s0kil
s0kil / purple-yolk-vscode.md
Last active February 24, 2021 15:09
Setting Up VS Code purple-yolk Extension With IHP

Integrating purple-yolk With IHP

  • In your IHP project directory, create a file named .ghci-purple-yolk and copy the contents of the .ghci file
  • Add :l Main.hs to the end of the .ghci-purple-yolk file

.ghci-purple-yolk should look something like:

:set -XNoImplicitPrelude
:def source readFile
@s0kil
s0kil / Haskell for Imperative Programmers.md
Last active February 9, 2021 03:36
Haskell for Imperative Programmers
  • 01. Basics
  • 02. Functions, Types, let & where
  • 03. Recursion, Guards, Patterns
  • 04. Lists and Tuples
  • 05. List Exercises
  • 06. Higher Order Functions & Anonymous Functions
  • 07. Partial Function Application & Currying
  • 08. Function Composition
@s0kil
s0kil / firstBy.hs
Last active December 24, 2020 15:31
Haskell `firstBy :: (a -> a -> Bool) -> [a] -> Maybe a`
firstBy :: (a -> a -> Bool) -> [a] -> Maybe a
firstBy _ [] = Nothing
firstBy _ [_] = Nothing
firstBy predicate (first : second : rest) =
if predicate first second
then Just second
else firstBy predicate (second : rest)
@s0kil
s0kil / wsl2-proc-version
Created December 18, 2020 20:37
`/proc/version` On WSL2
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020
require 'capybara/apparition'
Capybara.server = :puma, { Silent: true }
Capybara.register_driver :chrome_headless do |app|
Capybara::Apparition::Driver.new(app, { headless: true, browser_options: { 'headless': '', 'no-sandbox': '' } })
end
Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox])
@s0kil
s0kil / FPPiS.md
Last active December 13, 2020 19:10
Functional Programming Principles in Scala
@s0kil
s0kil / git-file-history.sh
Created December 12, 2020 01:59
Show History Of File At Any State, Modified, Deleted
git log --all --full-history -- ./the/file/path.md
# Thanks To: https://stackoverflow.com/a/7203551/7889817
@s0kil
s0kil / Program.fs
Created November 19, 2020 23:49
Avalonia.FuncUI with Elmish and Live.Avalonia
namespace MyGreatApp
open Elmish
open Avalonia
open Live.Avalonia
open Avalonia.Input
open Avalonia.FuncUI
open Avalonia.Controls
open Avalonia.FuncUI.Elmish
open Avalonia.FuncUI.Components.Hosts