Skip to content

Instantly share code, notes, and snippets.

Serhii Khoma srghma

View GitHub Profile
@srghma
srghma / LICENSE
Last active May 22, 2020
This license applies to all public gists and my comments in https://gist.github.com/srghma
View LICENSE
MIT License
Copyright (c) 2020 Serhii Khoma
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
View commit messages structure.md

I write commits with this linter https://github.com/srghma/linted-git-commit

Structure:

type: scope (e.g. page name) or noun -> scope (e.g. widget name) or noun -> verb (optional)

I use only 3 varians of "type":

  • feat: Adds a new feature.
View codebreaker-test1.hs
module GameLoopSpec where
import Protolude
import Cli.AbstractUtils
import Cli.GameLoop
import Cli.Monads
import Cli.Types
import Test.Hspec
View nixops-how-to-use-local-ssh-key-when-deploying-on-machine-with-existing-nixos.sh
stage_ssh () {
ssh \
root@${stage_ip} \
-i ${toString ../secrets/stage_root_key} \
$@
}
state_nixos_rebuild () {
NIX_SSHOPTS="-i ${toString ../secrets/stage_root_key}" \
nixos-rebuild \
View haskell_summary.md
```js
async function fetch(_ignoring) {
return {
user: {
username: "MyUsername"
}
}
}
async function fetchUserAndDoCalaculation() {
View keybase.md

Keybase proof

I hereby claim:

  • I am srghma on github.
  • I am srghma (https://keybase.io/srghma) on keybase.
  • I have a public key ASD1MDtsbC5cqzbn5RevzNhsStSznnYts4jteE43idPIAwo

To claim this, I am signing this object:

View what each nix Dev should know.md

fix function - https://github.com/NixOS/nixpkgs/blob/9f087964709174424bca681b600af8ee8e763df5/lib/fixed-points.nix#L19 , https://en.m.wikipedia.org/wiki/Fixed_point_(mathematics) , point where x = f(x) = f(f(f(f....f(x)....)))

rec { a = 1; b = a + 1; } is the same as fix (self: { a = 1; b = self.a + 1; })

builtins.trace - https://github.com/NixOS/nixpkgs/blob/9f087964709174424bca681b600af8ee8e763df5/lib/debug.nix#L4 trace has different flavors, http://hackage.haskell.org/package/base-4.12.0.0/docs/Debug-Trace.html#v:trace all lazy languages have trace

builtins.seq - in lazy languages data is represented as thunks (IF data has not been yet evaluated THEN it's pointer on function that should produce this data ELSE it's pointer on data), builtins.seq forces first layer of data to evaluate (evaluates it to WHNF?), builtins.deepSeq is recursive variant of seq, it forces whole data to evaluate (evaluates it to NF?), (more https://wiki.haskell.org/Seq, https://www.google.com/amp/s/amp.reddit.

View nix override flavours.md
You can’t perform that action at this time.