Skip to content

Instantly share code, notes, and snippets.

View lehmacdj's full-sized avatar

Devin Lehmacher lehmacdj

View GitHub Profile
@lehmacdj
lehmacdj / libpq_squeal_bug_repro_attempt.hs
Created October 25, 2022 00:22
Repro attempt using postgresql-libpq instead of squeal for https://github.com/morphismtech/squeal/discussions/334
#!/usr/bin/env stack
{- stack script
--resolver lts-19.30
--package postgresql-libpq
--package bytestring
-}
{-# LANGUAGE OverloadedStrings #-}
-- | To run, start a local postgresql database, potentially alter the
@lehmacdj
lehmacdj / evil-mode.lisp
Last active August 6, 2019 10:00
Evil mode for nEXT browser
(in-package :next)
(defparenstatic scroll-half-page-down
(ps:chain window (scroll-by 0 (/ (ps:@ window inner-height) 2))))
(defparenstatic scroll-half-page-up
(ps:chain window (scroll-by 0 (/ (ps:@ window inner-height) -2))))
(defparenstatic scroll-page-down
(ps:chain window (scroll-by 0 (ps:@ window inner-height))))
(defparenstatic scroll-page-up
(ps:chain window (scroll-by 0 (- (ps:@ window inner-height)))))
Excercises given in:
[Origami Programming](http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/origami.pdf)
> {-# LANGUAGE OverloadedLists, TypeFamilies #-}
> {-# LANGUAGE ViewPatterns #-}
> {-# LANGUAGE ScopedTypeVariables #-}
> {-# LANGUAGE TemplateHaskell #-}
> import GHC.Exts (IsList, fromList, Item, toList)
> import Data.Maybe (isJust, fromJust)
> import Test.QuickCheck.All
@lehmacdj
lehmacdj / learn_hexadecimal.hs
Last active July 31, 2018 23:42
a really tiny sloppy Haskell program to try to teach myself to add/multiply hexadecimal numbers without translating to decimal
#!/usr/bin/env stack
{- stack --install-ghc script
--resolver lts-11.4
--package ilist
--package mtl
--package random
-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE TypeApplications #-}
@lehmacdj
lehmacdj / log_py2_script
Created May 15, 2017 04:51
Deoplete bug traces
2017-05-15 00:47:29,846 [DEBUG @ msgpack_stream.py:send:33] 73602 - sent [0, 1, 'vim_get_api_info', ()]
2017-05-15 00:47:29,846 [DEBUG @ base.py:send:113] 73602 - Sending 'î∞vim_get_api_infoê'
2017-05-15 00:47:29,847 [DEBUG @ base.py:run:138] 73602 - Entering event loop
2017-05-15 00:47:29,847 [DEBUG @ msgpack_stream.py:_on_data:54] 73602 - waiting for message...
2017-05-15 00:47:29,847 [DEBUG @ msgpack_stream.py:_on_data:56] 73602 - received message: [0, 1, 'poll', []]
2017-05-15 00:47:29,847 [DEBUG @ async_session.py:_on_request:86] 73602 - received request: poll, []
2017-05-15 00:47:29,847 [DEBUG @ msgpack_stream.py:_on_data:54] 73602 - waiting for message...
2017-05-15 00:47:29,847 [DEBUG @ msgpack_stream.py:_on_data:59] 73602 - unpacker needs more data...
2017-05-15 00:47:29,848 [DEBUG @ msgpack_stream.py:_on_data:54] 73602 - waiting for message...
2017-05-15 00:47:29,848 [DEBUG @ msgpack_stream.py:_on_data:59] 73602 - unpacker needs more data...

Keybase proof

I hereby claim:

  • I am lehmacdj on github.
  • I am lehmacdj (https://keybase.io/lehmacdj) on keybase.
  • I have a public key ASBslYslfRIcT0KlsDnZXPLgoI9P_5qy4jVnLIfFLXZWwgo

To claim this, I am signing this object:

@lehmacdj
lehmacdj / exrc.vim
Created April 7, 2016 15:12
wasavi exrc
" map jk to <esc>
map! jk <esc>
" set a theme
set theme=solarized
set jkdenotative
set incsearch
set undolevels=1000
set smartcase
" Although it is nice to be able to use typelinkhints
" the fact that it is so much easier to type 2 letters
" than 2-3 numbers makes the cost of numerichints far
" from worth it.
" set numerichints
" set typelinkhints
set incsearch
map <C-f> scrollFullPageDown