Skip to content

Instantly share code, notes, and snippets.

View Kazark's full-sized avatar

Keith Pinson Kazark

  • Undisclosed
View GitHub Profile
@Kazark
Kazark / ExhaustivePrint.idr
Created January 12, 2019 21:15
How to create exhaustive print function for "enum" in Idris, off a string map
%default total
data RPS = Rock | Paper | Scissors
Eq RPS where
Rock == Rock = True
Paper == Paper = True
Scissors == Scissors = True
_ == _ = False
@Kazark
Kazark / Rubik.idr
Last active December 28, 2018 03:01
Considering only one face of a Rubik's cube: reduce a set of turns to an orientation
module Rubik
%default total
%access public export
||| "North", "south", "east" and "west" face orientations
data Orient = N | E | S | W
turnCW : Orient -> Orient
turnCW N = E
@Kazark
Kazark / NotNotLEM.idr
Last active November 13, 2018 15:17
Intuitionist logic is by no means denying the law of excluded middle!
module NotNotLEM
%default total
%access public export
notDistributesOverEither : Not (Either a b) -> (Not a, Not b)
notDistributesOverEither neither = (notLeft neither, notRight neither) where
notLeft : Not (Either a b) -> Not a
notLeft neither x = neither (Left x)
@Kazark
Kazark / wdiff.vim
Created July 8, 2017 12:56 — forked from ynkdir/wdiff.vim
wdiff.vim
" Usage:
" Copy this file to your ~/.vim/autoload directory.
" :edit oldfile
" :new newfile
" :call wdiff#highlight(2, 1) " wdiff#highlight(winnr1, winnr2)
let s:save_cpo = &cpo
set cpo&vim
function wdiff#highlight(Awinnr, Bwinnr)
@Kazark
Kazark / TKD.hs
Created September 15, 2016 19:24
Code from LambdaConf 2015 Type Kwan Do workshop
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE ScopedTypeVariables #-}
module TKD where
import Control.Applicative
befunge :: (x -> y) -> (y -> (w, z)) -> x -> w
befunge f g =
fst . g . f
@Kazark
Kazark / choco.log
Created June 30, 2016 20:46
choco install psexec fails now
Chocolatey is running on Windows v 6.3.9600.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install psexec -debug -verbose
Received arguments: install psexec -debug -verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
<!-- GistID: b0b77af78032899145fb0ed50737fe6a -->
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2016-06-17 09:36:38" build="160612">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::PowerShell}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@Kazark
Kazark / .vimrc
Last active September 5, 2017 15:06
" GistID: 1f58a89ee81c0c2620e3
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
if has("win32")
set runtimepath+=~/vimfiles/bundle/Vundle.vim
call vundle#begin('~/vimfiles/bundle')
else
set runtimepath+=~/.vim/bundle/Vundle.vim
@Kazark
Kazark / vimPluginReg.md
Last active March 17, 2016 18:20
Vim plugin Registry

My Vim Plugin Registry

General

  • Abolish
  • Airline
  • CtrlP
  • Endwise
" Gist-ID: 84e25967614138136eca
" Screw Vi-compatibility; let's make sense around here
" From http://vimrcfu.com/snippet/88
map Y y$
" From my Kazarc plugin https://github.com/Kazark/vim-kazarc -----------------
" Why hold down the shift key? The default mapping of ; is not very useful
nmap ; :
vmap ; :