Skip to content

Instantly share code, notes, and snippets.

View vladimirlogachev's full-sized avatar

Vladimir Logachev vladimirlogachev

View GitHub Profile
@vladimirlogachev
vladimirlogachev / Dockerfile.context
Created January 5, 2024 16:02
Dockerfile.context
FROM ubuntu:latest
RUN apt-get update && apt-get install tree
WORKDIR /test
COPY . .
# Note: `-a` = show hidden files
CMD ["tree", "-a"]
# This file allows to check your .dockergignore configuration
# Usage:
@vladimirlogachev
vladimirlogachev / Playground.hs
Created April 24, 2022 13:05
Plutus Playground Smart Contract
-- This is a starter contract, based on the Game contract,
-- containing the bare minimum required scaffolding.
--
-- What you should change to something more suitable for
-- your use case:
-- * The MyDatum type
-- * The MyRedeemer type
--
-- And add function implementations (and rename them to
-- something suitable) for the endpoints:
@vladimirlogachev
vladimirlogachev / Playground.hs
Created April 24, 2022 13:04
Plutus Playground Smart Contract
import Data.Text qualified as T
import Playground.Contract
import Plutus.Contract
import PlutusTx.Prelude
import Prelude qualified as Haskell
-- | A 'Contract' that logs a message.
hello :: Contract () EmptySchema T.Text ()
hello = logInfo @Haskell.String "Hello, world"
#xmonad shit
export _JAVA_AWT_WM_NONREPARENTING=1
# cargo
export PATH="$HOME/.cargo/bin:$PATH"
# haskell stack
export PATH="$HOME/.local/bin:$PATH"
# yarn
{
"workbench.startupEditor": "none",
"git.path": "/usr/bin",
"workbench.colorTheme": "Darktooth",
"window.zoomLevel": 0,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"git.autofetch": true,
"workbench.sideBar.location": "right",
"workbench.activityBar.visible": false,
@vladimirlogachev
vladimirlogachev / memoize.js
Last active April 1, 2019 03:28
memoize.js
// 1 arg
const memoize = equality1 => f1 => {
const resIndex = 1; // extract res from tuple
const results = []; // :: [[arg1, result]]
return arg1 => {
const cachedResult = results.find(([a1]) => equality1(a1, arg1));
if (!cachedResult) {
const newResult = f1(arg1);
results.push([arg1, newResult]);
return newResult;

What a test should contain

  • Description of what a thing is promising to user, with what conditions ('it should load and run player')
  • Assertion

How to write test code:

  • Dependencies (services and components) should be mocked. No real net / FS interaction should be left in unit tests.
  • We shouild have 1 mock per 1 service. And their public interfaces must be equivalent.
sudo dnf install openjfx
sudo dnf install java-1.8.0-openjdk-openjfx
@vladimirlogachev
vladimirlogachev / Unit testing requirements.md
Last active November 8, 2018 15:51
Unit testing requirements

What to cover (React):

  • component snapshots (conditional rendering situations also),
  • component event handlers (props to have been called, or actions to be dispatched),
  • component lifecycle methods,
  • utilities: validators, formatters, other pure functions,
  • reducers (with action creators, maybe also transformations, composed in pipes),
  • sagas,
  • anything responsible of behaviour.