This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- stack script | |
--resolver=nightly-2019-12-08 | |
--package=base-unicode-symbols | |
--package=hashable | |
-} | |
-- Author: Viacheslav Lotsmanov <lotsmanov89@gmail.com> | |
-- Date: December 2019 | |
-- License: BSD-3-Clause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- stack script | |
--resolver=lts-14.7 | |
--package=aeson | |
--package=attoparsec | |
--package=text | |
--package=unordered-containers | |
-} | |
{-# OPTIONS_GHC -Wall -Wno-missing-signatures #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Compile with this command, get rid of access to run by random users, | |
-- set SUID (to run by root), give ACL read+executing access | |
-- to your own user only ('uc' for instance, replace to your own user name): | |
-- | |
-- stack ghc --resolver=lts-14.7 \ | |
-- --package=directory \ | |
-- --package=filepath \ | |
-- --package=typed-process \ | |
-- --package=unix \ | |
-- -- -Wall -O2 -j$(nproc --all) grant-access-to-input-devices.hs && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Compile with this command, get rid of access to run by random users, | |
-- set SUID (to run by root), give ACL read+executing access | |
-- to your own user only ('uc' for instance, replace to your own user name): | |
-- | |
-- stack ghc --resolver=lts-14.7 \ | |
-- --package=attoparsec \ | |
-- --package=filepath \ | |
-- -- -Wall -O2 -j$(nproc --all) laptop-backlight.hs && | |
-- chmod 4550 laptop-backlight && | |
-- setfacl -m u:uc:rx laptop-backlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
BG_COLOR=black; FG_DEFAULT_COLOR=white | |
TEXT=$1; FG_COLOR=$2; [[ -z $FG_COLOR ]] && FG_COLOR=$FG_DEFAULT_COLOR | |
WM_TITLE='dzen-box' | |
BUS="/tmp/${WM_TITLE}-u${UID}-d${DISPLAY#:}" | |
BUS_LOCK="${BUS}.lock" | |
FONT_FAMILY=Hack; FONT_STYLE=bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack script --resolver=lts-13.27 --ghc-options -Wincomplete-patterns | |
{-# LANGUAGE GADTs, DataKinds, TypeFamilies, TypeOperators #-} | |
{-# LANGUAGE FlexibleInstances, UndecidableInstances, DeriveGeneric #-} | |
import GHC.Generics | |
import GHC.TypeLits | |
type family MetaDataOf (typeRep :: * -> *) (typeName :: Symbol) :: Meta where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
Point = tuple[x: float, y: float] | |
PictureKind* = enum | |
Blank, Polygon, Line, Circle, ThickCircle, Arc, | |
ThickArc, Text, Translate, Rotate, Scale, Pictures | |
Picture* = object | |
case kind*: PictureKind | |
of Blank: discard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{-stack script | |
--resolver=lts-13.18 | |
--package=base-unicode-symbols | |
--package=array | |
--package=MonadRandom | |
--package=hspec | |
-} | |
-- Author: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script for connecting to VPN connections via Network Manager. | |
# all of these will be connected (`up' command). | |
# those which you want to be always connected when turn VPNs on. | |
vpns=( | |
foo | |
bar | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
use v6; | |
my Int \magic = 277777788888899; | |
my Str \separator = "\n" ~ "~" x 60 ~ "\n"; | |
my Int \cores = try { $*KERNEL.cpu-cores } // 1; | |
('CPU cores: ' ~ cores).say; | |
class CalcResult { |