Skip to content

Instantly share code, notes, and snippets.

View vyorkin's full-sized avatar
👾

Vasiliy Yorkin vyorkin

👾
View GitHub Profile
@vyorkin
vyorkin / zathurarc
Last active May 31, 2025 16:43
zathurarc
set selection-clipboard clipboard
set statusbar-h-padding 0
set statusbar-v-padding 0
set statusbar-home-tilde true
set page-padding 1
map u scroll half-up
map d scroll half-down
map D toggle_page_mode
map r reload
@vyorkin
vyorkin / crates.md
Created July 12, 2021 10:32
Substrate & Cumulus crates cheat sheet
  • sp - Substrate Primitives

  • sc - Substrate Client

  • sp-api - Substrate runtime API

  • sp-consensus - Common utilities for building and using consensus engines in Substrate

  • sp-consensus-aura - Primitives for Aura PoA consensus engine

  • sc-consensus-aura - Client primitives for Aura PoA consensus engine

  • sp-core - Shareable Substrate types

  • sp-finality-grandpa - Primitives for GRANDPA integration, suitable for WASM compilation

  • sp-runtime - Runtime Modules shared primitive types

{-# LANGUAGE ScopedTypeVariables #-}
import Foreign.Marshal.Array (newArray)
import Control.Exception (bracket)
import Data.Int (Int8)
import System.IO (IOMode(..), openBinaryFile, hClose, hPutBuf, hFlush)
main :: IO ()
main = bracket (openBinaryFile "rom.bin" WriteMode) hClose $ \handle -> do
let bytes = replicate 32768 (0xea :: Int8)
@vyorkin
vyorkin / shell.nix
Created June 15, 2019 11:07
parallel & concurrent haskell book shell.nix
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
let
inherit (nixpkgs) pkgs;
metapkgs = import (builtins.fetchTarball "https://github.com/matthewbauer/metapkgs/archive/master.tar.gz");
ghc = metapkgs.${compiler};
in pkgs.stdenv.mkDerivation {
name = "my-haskell-env-0";
buildInputs = [ ghc nixpkgs.zlib ];
shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
listFields ''MyData
======>
instance Show MyData where
GHC.Show.show x_agvh
= (intercalate ", ")
((map ($ x_agvh))
[\ x_agvi -> ("foo" ++ (" = " ++ GHC.Show.show (foo x_agvi))),
\ x_agvj -> ("bar" ++ (" = " ++ GHC.Show.show (bar x_agvj)))])
@vyorkin
vyorkin / sukablyat.nix
Created January 15, 2019 18:00
emacs serive nixos home-manager systemd
# see: https://github.com/rycee/home-manager/issues/299
# wait for: https://github.com/rycee/home-manager/pull/517/
systemd.user.services.emacs-daemon = {
Unit = {
Description = "Emacs text editor";
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.stdenv.shell} -l -c 'exec /run/current-system/sw/bin/emacs --fg-daemon'";
@vyorkin
vyorkin / WebSocket.purs
Created December 29, 2018 11:36
WebSocket.purs
module Chat.Web.Socket.WebSocket
( onClose
, onMessage
) where
import Prelude
import Chat.Data.Message (Message)
import Chat.Data.Message as Message
import Control.Monad.Except (runExcept)
import Data.Array as Array
@vyorkin
vyorkin / ParentView.purs
Created December 23, 2018 15:45 — forked from prathje/ParentView.purs
Raw Halogen HTML Component
module ParentView where
import Prelude
import Halogen as H
import Halogen.HTML as HH
import Halogen.HTML.Events as HE
import Halogen.HTML.Properties as HP
import Data.Maybe (Maybe(..))
import Control.Monad.Aff (Aff)
@vyorkin
vyorkin / output
Created December 8, 2018 16:55
company-diag ouput
Emacs 27.0.50 (x86_64-apple-darwin18.2.0) of 2018-11-08 on dead.local
Company 0.9.7
company-backends: (company-cabal company-elisp merlin-company-backend company-bbdb company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
(company-dabbrev-code company-gtags company-etags company-keywords)
company-oddmuse company-dabbrev)
Used backend: company-capf
Major mode: haskell-mode
Prefix: ""