Skip to content

Instantly share code, notes, and snippets.

View dmalikov's full-sized avatar
🥞
!

Dmitry Malikov dmalikov

🥞
!
View GitHub Profile
@dmalikov
dmalikov / README.md
Created July 15, 2024 22:59
remove HR from garmin activity

Remove HR from TCX file

Requirements

stack is required. On MacOS it can be installed via brew install stack.

Usage

Assuming there is an affected Garmin activity that you want to remove HR data from.

instance FromJSON Database where
- parseJSON (Object o) = Database
- <$> o .: "id"
- <*> o .: "_rid"
- <*> o .: "_ts"
- <*> o .: "_self"
- <*> o .: "_etag"
- <*> o .: "_colls"
- <*> o .: "_users"
+ parseJSON (Object o) =
@dmalikov
dmalikov / wat.ps1
Last active September 5, 2015 17:56
Meanwhile on the Planet of Adequate Programming Languages
################## PART ONE
> ("a" + "b" * 3).length
4
> ("a" + , "b" * 3).length
6
################## PART TWO
> if (2 > 1) { echo "two is larger than one" } else { echo "no it is not" }
no it is not
@dmalikov
dmalikov / gist:7ad1e9331c696f437c38
Created May 2, 2015 21:18
nix-shell -p haskellngPackages.cabal2nix
>> nix-shell -p haskellngPackages.cabal2nix
these derivations will be built:
/nix/store/34i3bkyry0lfxbxmcx4s1ilricwhhqv3-hscolour-1.21.tar.gz.drv
/nix/store/1dvakqvcwk4hsfzl3fhy2fml30j0ar3y-hscolour-1.21.drv
/nix/store/giqr5pcds9r1mpwi806r4yvsq6pi50wh-haskell-mtl-2.1.3.1.drv
/nix/store/si9rsg03d181vwxwavpgyvxxjhn7hc5d-haskell-logict-0.6.0.2.drv
/nix/store/04xhj4cz4cwcj9xa74b0z1q0934iypj9-haskell-smallcheck-1.1.1.drv
/nix/store/0l3p4a85a0r6m0sg6rld7agj3l7jyyi3-tasty-golden-2.2.2.4.tar.gz.drv
/nix/store/0pyk34zzr2m1wh16fgyhn5gxrxs101gg-syb-0.4.4.tar.gz.drv
/nix/store/0qql92h7l71g9ncz3mdzh6maim6qkbwr-abstract-deque-0.3.tar.gz.drv
@dmalikov
dmalikov / diffsdiff.md
Created April 30, 2015 15:06
`git-diff` != `git-diff-tree`?

Suppose there is a commit C which have a single parent commit P.

Let's say that TC and TP are the corresponding tree objects.

Why git diff P C is not always equal to git diff-tree TP TC -p?


Why they should be equal?

@-moz-document domain("manage.windowsazure.com") {
#headerbar-wrapper {
width: 100%;
margin-left: 0;
left: 0;
}
#fxshell-navpane {
left: 0;
margin-left: 0;
}
@dmalikov
dmalikov / Main.hs
Last active August 29, 2015 14:10
nix-shell behaves assimetrically pointing at local default.nix and using global ~/.nixpkgs/config.nix tree
main = print 1
@dmalikov
dmalikov / ghc-pkg-check
Created November 3, 2014 10:32
[doing-something-wrong] nixos produces tons of dead haskell packages
There are problems in package yaml-0.8.9.3:
dependency "base-4.7.0.1-1acdd7bb255299e13f52849f98f9b3f2" doesn't exist
dependency "bytestring-0.10.4.0-3b693323d00f6a0050c2715338d2dd69" doesn't exist
dependency "containers-0.5.5.1-b89e8be9f833fcd6797b611973bba2ab" doesn't exist
There are problems in package void-0.6.1:
dependency "base-4.7.0.1-1acdd7bb255299e13f52849f98f9b3f2" doesn't exist
There are problems in package vector-0.10.12.1:
dependency "base-4.7.0.1-1acdd7bb255299e13f52849f98f9b3f2" doesn't exist
dependency "deepseq-1.3.0.2-d8a716b4bcd889c2b54a65c492a75647" doesn't exist
There are problems in package unordered-containers-0.2.5.1:
@dmalikov
dmalikov / gist:55d83f5f3062a604cae3
Last active August 29, 2015 14:07
[wat] `nixos-rebuild switch` switches tig version from 2.0.3 to 1.2.1 like clockwork
# I'm just calling same `sudo nixos-rebuild switch` command many times from the same directory
yep@nixos : ~ >> sudo nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/6r8b8k9b59fi3nckb8w1dzxxydp4s87j-unit.drv
/nix/store/cf68gijlb05fjcpzsnjl7yhq92b9mmv4-system-units.drv
/nix/store/g83gindm03c4wzbwj99nvcviszyp1527-nixos-14.10.git.7d0a7ed.drv
/nix/store/ha3vd3igichjwlj263nz0ap2vk0hn69s-sshd.pam.drv
@dmalikov
dmalikov / gist:38794149b7670f44a252
Created October 18, 2014 20:29
nix-shell failure because of cabal warning
>> nix-shell -p myHaskellPackages.dotfiles
these derivations will be built:
/nix/store/7rq3fqv0ia687v70bhxb609fnid340wl-dotfiles-9999.drv
building path(s) `/nix/store/c0k5926bn1gsvwfln6ahncx0awihgb13-dotfiles-9999'
building /nix/store/c0k5926bn1gsvwfln6ahncx0awihgb13-dotfiles-9999
unpacking sources
unpacking source archive /nix/store/g761dl7mirwfcawgw4hpknmz2gcd6hcd-biegunka
source root is biegunka
patching sources
configuring