Skip to content

Instantly share code, notes, and snippets.

View kirikaza's full-sized avatar

Kirill Kazakov kirikaza

View GitHub Profile
@jliuhtonen
jliuhtonen / Reader.elm
Created April 13, 2016 17:53
Reader monad in Elm for fun and profit
module Reader where
type Reader ctx a = Reader (ctx -> a)
unit: a -> Reader any a
unit x =
Reader (\_ -> x)
@avdyushin
avdyushin / ghci.conf
Last active August 14, 2016 09:53
Nice λ prompt at ~/.ghc/ghci.conf
import qualified Control.Applicative
import qualified Data.Char
import qualified Data.List
:set prompt "\ESC[34m\STX λ \ESC[m\STX"
:set +t
:set +m
@gilbertw1
gilbertw1 / .Xresources
Last active December 2, 2022 10:51
XMonad Configuration
Xft.dpi: 120
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintslight
rofi.color-enabled: true
rofi.color-window: #282828, #282828, #268bd2
rofi.color-normal: #282828, #ffffff, #282828, #268bd2, #ffffff
rofi.color-active: #282828, #268bd2, #282828, #268bd2, #205171
@sunng87
sunng87 / reflection.clj
Created November 20, 2015 10:04
clojure: access private field/method via reflection
(defn invoke-private-method [obj fn-name-string & args]
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string)))
(.. obj getClass getDeclaredMethods)))]
(. m (setAccessible true))
(. m (invoke obj args))))
(defn private-field [obj fn-name-string]
(let [m (.. obj getClass (getDeclaredField fn-name-string))]
(. m (setAccessible true))
(. m (get obj))))
@mikhailov
mikhailov / Vagrantless
Last active October 15, 2017 09:37
Vagrantless (draft), tested on OS X only.
# This the bash script to handle up-and-runnig VM created through Vagrant
#!/usr/bin/env bash
# PRIVATE: error level message
error_message () {
echo "$(tput setaf 1)ERROR: $1$(tput sgr0)"
}