Skip to content

Instantly share code, notes, and snippets.

View piq9117's full-sized avatar
๐Ÿ’€
Nothing good is happening here

piq9117 piq9117

๐Ÿ’€
Nothing good is happening here
View GitHub Profile
@piq9117
piq9117 / doom.txt
Created July 19, 2019 21:09 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@piq9117
piq9117 / PhantomTypeReasonML.md
Created November 8, 2018 03:19 — forked from busypeoples/PhantomTypeReasonML.md
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@piq9117
piq9117 / Monad.ml
Created November 5, 2018 23:07 — forked from nvanderw/Monad.ml
IO Monad in OCaml
module type FUNCTOR = sig
type 'v f
val map : ('a -> 'b) -> 'a f -> 'b f
end
module type MONAD = sig
type 'v f
val map : ('a -> 'b) -> 'a f -> 'b f
val pure : 'a -> 'a f
val join : ('a f) f -> 'a f
@piq9117
piq9117 / Monad.ml
Created November 5, 2018 23:07 — forked from nvanderw/Monad.ml
IO Monad in OCaml
module type FUNCTOR = sig
type 'v f
val map : ('a -> 'b) -> 'a f -> 'b f
end
module type MONAD = sig
type 'v f
val map : ('a -> 'b) -> 'a f -> 'b f
val pure : 'a -> 'a f
val join : ('a f) f -> 'a f
@piq9117
piq9117 / nativeJavaScript.js
Created September 28, 2018 20:20 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@piq9117
piq9117 / IosevkaConfigGen.hs
Created September 16, 2018 22:06 — forked from mrkgnao/IosevkaConfigGen.hs
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB
@piq9117
piq9117 / ts-quasar-cli.md
Created September 9, 2018 01:34 — forked from snowyu/ts-quasar-cli.md
Add the typescript supports to quasar framework

Note: This guide applies to the project created by quasar-cli.

First install typescript and ts-loaderpackages in your project.

npm i -D typescript ts-loader

Then modified the quasar.conf.js file in your project:

@piq9117
piq9117 / state.hs
Created July 31, 2018 18:35 — forked from sdiehl/state.hs
State monad implementation + example
import Control.Monad
-------------------------------------------------------------------------------
-- State Monad Implementation
-------------------------------------------------------------------------------
newtype State s a = State { runState :: s -> (a,s) }
instance Monad (State s) where
return a = State $ \s -> (a, s)
@piq9117
piq9117 / spacemacs-keybindings
Last active January 26, 2021 07:19 — forked from adham90/spacemacs-keybindings
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
@piq9117
piq9117 / combinators.js
Created February 4, 2018 01:29 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));