Skip to content

Instantly share code, notes, and snippets.

View fehu's full-sized avatar
💭
it's compiling...

Dmitry K fehu

💭
it's compiling...
  • Mexico City, Mexico
View GitHub Profile
@fehu
fehu / configuration.nix
Last active November 15, 2019 01:58
NixOS config
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
let
all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
in {
imports =

Keybase proof

I hereby claim:

  • I am fehu on github.
  • I am dkovalev (https://keybase.io/dkovalev) on keybase.
  • I have a public key ASC6jkjcXJdj3mGGdz30gh8gsZlZ2FKeHiiuGlskS8MQVQo

To claim this, I am signing this object:

@fehu
fehu / MacroQuestion.scala
Created January 25, 2018 19:38
Macro Question
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
object MacroQuestion {
def apply[F[_], A]: Any = macro impl[F, A]
def impl[F[_], A](c: whitebox.Context)(
implicit F: c.WeakTypeTag[F[_]], A: c.WeakTypeTag[A]
): c.Tree = {
import c.universe._
@fehu
fehu / predef.sc
Created December 20, 2017 21:52
ammonite predef
interp.load.ivy(
"com.lihaoyi" %
s"ammonite-shell_${scala.util.Properties.versionNumberString}" %
ammonite.Constants.version
)
@
val shellSession = ammonite.shell.ShellSession()
import shellSession._
import ammonite.ops._
import ammonite.shell._
@fehu
fehu / CovUnliftFilter.scala
Created November 17, 2017 04:33
Scala - shapeless - CovUnliftFilter
import scala.language.higherKinds
import shapeless._
import shapeless.ops.hlist.IsHCons
/**
* Type class supporting access to all the elements of this `HList`, that are lifted sub-types of `U`.
* Selects all {{{ F[A] }}}, contained in the list `L`, such that {{{ A <: U }}}.
*/
trait CovUnliftFilter[L <: HList, F[_], U] extends DepFn1[L] with Serializable { type Out <: HList }
@fehu
fehu / .xinitrc.mine
Last active August 11, 2017 03:37
.xinitrc
# Set background with feh
./.fehbg
# Keyboard setup
setxkbmap "us,ru" "altgr-intl," "grp:caps_toggle" "terminate:ctrl_alt_bksp"
# Disable Natural Scrolling
xinput --set-prop 13 314 0
# Enable While Typing
xinput --set-prop 13 326 0
@fehu
fehu / xmobar.hs
Last active August 14, 2018 18:00
xmobar config
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, additionalFonts = []
, borderColor = "black"
, border = TopB
, bgColor = "black"
, fgColor = "grey"
, alpha = 255
, position = TopW L 100
, textOffset = -1
, iconOffset = -1
@fehu
fehu / xmonad.hs
Last active April 30, 2018 19:52
xmonad setup
{-# OPTIONS_GHC -w #-}
import XMonad
import XMonad.Util.EZConfig
import XMonad.Util.NamedActions
import XMonad.Util.Run(spawnPipe)
import Graphics.X11.ExtraTypes.XF86
import XMonad.Layout.NoBorders
@fehu
fehu / xorg.conf-keyboard
Created May 28, 2017 21:16
xorg.conf keyboard: English Alt Gr International, Russian. Switch: Caps Lock
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputClass"
Identifier "Keyboard0"
MatchIsKeyboard "on"
Option "XkbModel" "pc105"
@fehu
fehu / configuration.nix
Created March 31, 2017 12:13
for virtualbox with xmonad
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix