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
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
@piq9117
piq9117 / gist:06e659563b720e5d505a282b55fa3e40
Created October 31, 2019 22:45 — forked from MaxGabriel/gist:9e757f2da60ac53b45bb06b2b097d86b
persistent-postgresql case insensitive text
-- First enable citext in psql: CREATE EXTENSION IF NOT EXISTS citext;
-- Create Model/CustomTypes.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Model.CustomTypes where
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
inherit (pkgs) haskellPackages;
haskellDeps = ps: with ps; [
stack
dbmigrations
cabal-helper
@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 / remove-branch.sh
Created July 8, 2019 20:10
delete all branches except master.
git branch | grep -v "master" | xargs git branch -D
import Data.Aeson
import Data.HashMap.Lazy
mergeAeson :: [Value] -> Value
mergeAeson = Object . union . fmap (\(Object o -> o)
import { fromNullable } from 'fp-ts/lib/Option';
import { reader, ask } from "fp-ts/lib/Reader";
/**
* seperate a number by thousands, using a commas every three decimal places
* in numbers of four or more digits, counting right to left.
*/
// TODO: removed "$" and create an internationalizaiton map for currency.
const noTrailingZeroRegex = new RegExp(/\B(?=(\d{3})+(?!\d))/g);
<link rel="stylesheet" type="text/css" href="https://unpkg.com/quasar-framework@^0.17.0/dist/umd/quasar.mat.min.css">
<script src="https://unpkg.com/quasar-framework@^0.17.0/dist/umd/quasar.mat.umd.min.js"></script>
<div id="app">
<q-table
:data="tableData"
:columns="columns"
:separator="separator"
dense
row-key="col1"
collapse :: Either e1 (Either e2 a) -> Either (Either e1 e2) a
collapse = either (Left . Left) (either (Left . Right) Right)