Skip to content

Instantly share code, notes, and snippets.

View arialdomartini's full-sized avatar

Arialdo Martini arialdomartini

View GitHub Profile
@arialdomartini
arialdomartini / example.hs
Created September 30, 2022 08:24
Haskell clashing records and DisambiguateRecordFields
------- RecordSpec.hs
{-# LANGUAGE DisambiguateRecordFields #-} -- This is mandatory, even if the 2 records are defined in different modules!
module RecordSpec where
import Test.Hspec
import Record2
data Person = Person { firstName :: String }
@arialdomartini
arialdomartini / where.hs
Created September 25, 2022 08:26
where give indentation error
{-# OPTIONS_GHC -Wno-type-defaults #-}
module FunctionComposition where
import Test.Hspec
spec :: Spec
spec = do
it "can use point free style" $ do
sum' [1,2,3] `shouldBe` 1 + 2 + 3
@arialdomartini
arialdomartini / find-next-tag.sh
Created September 19, 2022 20:45
git next tag
a=$(git tag --points-at HEAD) && a=$(("$a+1")) && echo $a
@arialdomartini
arialdomartini / Gitgit.sh
Last active September 9, 2022 05:34
Git git git
git config --global alias.git clone \
sudo bash -c \
'echo "gitgit.git 192.30.255.113" \
>> /etc/hosts'
git git git://gitgit.git/git/git
@arialdomartini
arialdomartini / final.cs
Created April 14, 2022 11:50
final behavior
[Fact]
void final_1()
{
int F()
{
int i = 1;
try
{
return i;
fibs = 1: 1: zipWith (+) fibs (tail fibs)
sort [] = []
sort (x:xs) =
smallerSorted ++ [x] ++ largerSorted
where
smallerSorted = sort [a | a <- xs, a <= x]
largerSorted = sort [a | a <- xs, a > x ]
@arialdomartini
arialdomartini / y-combinator.scm
Created November 27, 2020 08:04
y-combinator in strict Scheme
;; ordinary factorial
(define (zero? n)
(= n 0))
(define (decr n)
(- n 1))
(define (fact n)
@arialdomartini
arialdomartini / IsLazy.cs
Last active July 23, 2020 07:21
Check if LINQ execution is lazy
public class LazynessTest
{
internal static ITestOutputHelper TestOutputHelper;
public LazynessTest(ITestOutputHelper testOutputHelper)
{
TestOutputHelper = testOutputHelper;
}
[Fact]
@arialdomartini
arialdomartini / karabiner.json
Created May 3, 2020 07:05
Gian "Touch Typing" Pace
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {