Skip to content

Instantly share code, notes, and snippets.

# OfflineImap config.
# copy to ~/.offlineimaprc
[general]
accounts = ISU
[Account ISU]
localrepository = Local
remoterepository = Remote
@jandrewthompson
jandrewthompson / scottydb.hs
Created January 25, 2017 19:27
This works, but am I doing it right?
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Main where
--import Web.Scotty
import Web.Scotty.Trans
import Data.Aeson (FromJSON, ToJSON)
import Data.Text.Lazy (Text)
import Data.Monoid ((<>))
@jandrewthompson
jandrewthompson / gen-symbols.rkt
Created April 13, 2015 19:19
Generate Vim dictionary file for Racket symbols
#lang racket/base
;; In .vimrc, add the following config or equivalent:
;; "au FileType scheme setlocal dict+=~/.racket-dict.vim"
;;
;; Any (require ..) forms in this source file will impact symbols generated
(require racket/gui/base)
(require racket/gui)
(require racket/draw)
@jandrewthompson
jandrewthompson / logind.conf
Last active August 29, 2015 14:01
Reviving power management features after kubuntu update.
##########################
# /etc/systemd/logind.conf was recently changed to intercept and
# eat power events (like laptop lid closing) BEFORE kde has a
# chance to act on them. Rendering System_Settings->Power_Management->Energy_Savings
# settings useless. The following settings should fix it.
##########################
#
#
# This file is part of systemd.
#
@jandrewthompson
jandrewthompson / gist:7456194
Created November 13, 2013 20:52
Datomic: querying as of a specific db instant
(q '[:find ?food
:where [?person :person/name "John"]
[?person :favorite/food ?food]]
(d/since database #inst "2012-01-01T00:00:00.000-00:00")
)
@jandrewthompson
jandrewthompson / kdiff3svn
Created September 18, 2013 19:42
Script for helping SVN and kdiff3 play nicely
#!/bin/bash
#################
# set 'merge-tool-cmd = kdiff3svn' in ~/.subversion/config
# ###############
kdiff3 $1 $2 $3 -o $4
@jandrewthompson
jandrewthompson / osctranslation.clj
Last active December 17, 2015 16:08
OSC translation layer
(ns oscplay.core)
(use 'overtone.osc)
(def PORT 8000)
(def mappings [{:from "/1/toggle1"
:to "/ardour/toggle1"}
{:from "/1/toggle2"
:to "/ardour/toggle2"}])
@jandrewthompson
jandrewthompson / journal.sh
Created May 3, 2013 17:49
Notify me to start journaling. Open my journal if its not already open. Otherwise, send it to foreground.
#!/bin/bash
JPID=`pgrep -f journal.wiki`
#Send an alert
kdialog --title "JOURNAL" --passivepopup "Write in your journal!"
if [ -z $JPID ]
then
/usr/bin/gvim ~/Dropbox/vimwiki/journal.wiki &
@jandrewthompson
jandrewthompson / types.hs
Created March 14, 2013 17:44
Haskell Typeclasses
import Text.Printf(printf)
data Message =
Message {msgType :: String,
msgTo :: String,
msgValue :: String}
deriving (Eq, Read)
data FooMessage =
FooMessage {msg :: Message,
@jandrewthompson
jandrewthompson / randombot.hs
Created March 11, 2013 22:15
Randomness Achieved!!!!!!!!
import Data.List
import Network
import System.IO
import System.Exit
import System.Random
import Control.Arrow
import Control.Monad.Reader
import Control.Exception
import Text.Printf
import Prelude hiding (catch)