Skip to content

Instantly share code, notes, and snippets.

View Cmdv's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Vincent Orr Cmdv

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
@Cmdv
Cmdv / Instances.hs
Last active October 15, 2021 10:07
Type level / Generic programming HS -> TS magic
deriving instance Generic UIConfig
instance AesonOptions UIConfig
instance S.Generic UIConfig
instance S.HasDatatypeInfo UIConfig
instance TS.TypeScript UIConfig
--------------------------------------------
-- Instance above errors with:
-- No instance for (Data.Aeson.TypeScript.GTypeBody
-- '[ '[UIConfigV001], '[[Char]]]
-- ('Generics.SOP.Type.Metadata.ADT
@Cmdv
Cmdv / Loop.hs
Last active September 1, 2021 16:30
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import RIO
import qualified RIO.Map as M
data Question = Question
@Cmdv
Cmdv / config.el
Created November 8, 2020 16:12
Emacs HLS setup
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "John Doe"
user-mail-address "[email protected]")
@Cmdv
Cmdv / .spacemacs
Created October 30, 2019 21:26
spacemacs setting 2019
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@Cmdv
Cmdv / .spacemacs
Created June 14, 2019 10:06
Spacemacs Haskell Stack
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@Cmdv
Cmdv / nested.hs
Last active November 2, 2018 11:48
Flatten a nested List of any given depth into a single level deep list.
module NestedListExercise where
import Test.QuickCheck
import Test.QuickCheck.Monadic
-------------------------------------------------------------------------------
-- ** Implemetation
-------------------------------------------------------------------------------
-- I wanted to do this little test using Haskell due to the type safety and how
-- we can randomly generate different nested lists to tests against our implementation.
function map (toSomething, obj) {
const newObj = {}
const keys = Object.keys(obj)
for (let i = 0; i < keys.length; ++i) {
const name = keys[i]
newObject[name] = toSomething(obj[name])
}
return newObj
}
@Cmdv
Cmdv / most.md
Last active April 12, 2016 14:16
                                          ,d     
                                          88     

88,dPYba,,adPYba, ,adPPYba, ,adPPYba, MM88MMM
88P' "88" "8a a8" "8a I8[ "" 88
88 88 88 8b d8 "Y8ba, 88 88 88 88 "8a, ,a8" aa ]8I 88, 88 88 88 "YbbdP"' `"YbbdP"' "Y888

o o o-o o-o o-O-o

@Cmdv
Cmdv / esnextbin.md
Created April 5, 2016 09:36
esnextbin sketch
@Cmdv
Cmdv / reactive-programming-cycle-js.md
Last active October 6, 2019 07:28
Reactive Programming & Cycle.js list of learning material