Skip to content

Instantly share code, notes, and snippets.

View yuanwang-wf's full-sized avatar

Yuan Wang yuanwang-wf

  • Workiva
  • Saskatoon
View GitHub Profile
#include QMK_KEYBOARD_H
#ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
# include "timer.h"
#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE
enum charybdis_keymap_layers {
LAYER_BASE = 0,
LAYER_FUNCTION,
LAYER_NAVIGATION,
@yuanwang-wf
yuanwang-wf / doom.txt
Last active April 9, 2021 11:24 — 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
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc882" } :
let
bootstrap = import <nixpkgs> { };
nixpkgs = builtins.fromJSON (builtins.readFile ./nixpkgs.json);
src = bootstrap.fetchFromGitHub {
owner = "NixOS";
@yuanwang-wf
yuanwang-wf / init.el
Created December 29, 2019 00:39
spacemacs config
;; -*- 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'
@yuanwang-wf
yuanwang-wf / home.nix
Created December 11, 2019 22:03
nix home
{ pkgs, ... }:
let home_directory = builtins.getEnv "HOME";
log_directory = "${home_directory}/Library/Logs";
tmp_directory = "/tmp";
ca-bundle_crt = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
lib = pkgs.stdenv.lib;
in rec {
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Char (isSpace)
import Data.Either (fromRight)
import qualified Data.Attoparsec.Text as Parser
import qualified Data.Text as Text
import qualified Data.Text.IO as TIO
main :: IO ()
@yuanwang-wf
yuanwang-wf / Deck.hs
Created February 22, 2019 22:46
State Monad examples
module Deck where
import Control.Applicative
import Control.Monad.Trans.State
import Data.List
import System.Random
data Rank = One | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queue | King deriving (Bounded, Enum, Show, Eq, Ord)
data Suit = Diamonds | Clubs | Hearts | Spades deriving (Bounded, Enum, Show, Eq, Ord)
@yuanwang-wf
yuanwang-wf / monad.hs
Last active June 28, 2018 22:21
Monad for Functional Programming
module Lib where
import Control.Arrow (first)
data Term = Con Int | Div Term Term deriving Show
eval :: Term -> Int
eval (Con a) = a
eval (Div t u) = eval t `div` eval u
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Course.Applicative where
import Course.Core
import Course.ExactlyOne
import Course.Functor