Skip to content

Instantly share code, notes, and snippets.

View drchaos's full-sized avatar

Yura Sheliah drchaos

View GitHub Profile
data IdType = One | Two | Three
deriving (Eq, Ord, Enum, Bounded)
genSingletons [''IdType]
type ID = Int
-- | Simplest newtype implementaion almost everithing can be derived
-- without defining handwritten instances. Can be stored in heterogeneous
-- collections
@drchaos
drchaos / pkgGroup.nix
Last active September 26, 2019 09:08
{ tryEval, pkgConfig, callPackage, fetchgitPrivate }:
let src = <path>;
lib1 = callPackage ./lib1.nix { inherit src; };
lib2 = callPackage ./lib2.nix { inherit src; };
lib3 = callPackage ./lib3.nix { inherit src;
inherit lib1;
inherit lib2; };
lib4 = callPackage ./lib4.nix { inherit src;
inherit lib3;
inherit lib1; };
@drchaos
drchaos / nix.conf
Created October 12, 2018 12:44
Speedup your nix now!
# Put this lines to your /etc/nix/nix.conf
max-jobs = auto
cores = 2
Rus Eng
Wisper of the sea Wisper of the sea
Прекрасная бирюза и гранатовые друзы нежно шепчут нам о лете, о море и об отдыхе в райском уголке:) В этом кулоне так же использована изумительной красоты бронзовая фурнитура от Анны Черных. Beautiful turquoise and Garnet druses gently whisper to us about summer, about a sea and about rest in a little slice of paradise :) A fantastic bronze findings from Anna Chernykh are used in this pendant.
Caribs Caribs
Манящие морские глубины, коралловые рифы, светящиеся рыбки и пальмовые леса - все это в чарующем камне хризоколла. Дыхание океана наполнит Ваши будни. Alluring sea depths, coral reefs, luminous fishes and palm forests are all inside enchanting chrysocolla stone. The breath of an ocean will fill your everyday life.
La perla La perla
Spirit of the sea Spirit of the sea
Кулон с моим любимым, сказочной красоты, лабрадоритом. Квинтэссенция морской воды, завораживает того, кто вглядывается в ее глубины, раскрывает секреты подводного мира. Мягко
@drchaos
drchaos / init.vim
Last active September 27, 2023 08:15
syntax on
filetype plugin indent on
set nocompatible
set number
set nowrap
set showmode
set tw=98
set smartcase
set smarttab
set smartindent

Настройка IDE для Haskell.

Для haskell есть haskell ide engine (далее hie).Это приблуда которая поддерживает Language Server Protocol и благодаря этому может интегрироваться со множеством редакторов (neovim, atom, emacs, sublime, vs code).

Установка hie nix-ом работающего с несколькими GHC одновременно - all-hies

Описана здесь . С помощью одной простой комманды вы можете установить HIE:

nix-env -iA selection --arg selector 'p: { inherit (p) ghc864 ghc863 ghc843; }' -f https://github.com/infinisil/all-hies/tarball/master
package main
import (
"encoding/csv"
"fmt"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"
"html/template"
"io"
"log"
@drchaos
drchaos / main.hs
Last active December 13, 2015 21:18
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables , OverloadedStrings #-}
module Main where
import Criterion.Main
import Criterion.Config
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C
import Data.Text as T