Skip to content

Instantly share code, notes, and snippets.

View mykhas's full-sized avatar

Mykhaś Kobernyk mykhas

View GitHub Profile

<2020-07-09 Thu> Front-End Testing Workshop

Kinds of tests

By object of testing:

  • unit tests — testing only one class/function, mocking all its dependencies;
  • integration tests — testing several units at a time within the same project. Usually, in implies mocking of input data, like API calls;
  • e2e tests — testing of the product. Usually is performed on the predefined DB snapshot, might test at the same time several
@mykhas
mykhas / leadership.org
Last active July 8, 2020 15:54
leadership-workshop-june-2020.org

<2020-06-09 Tue> Leadership & Management

Екологічність – турбота про людей, поступове вирощення і заохочення їх росту. Важливо не зашкодити, не зламати

Складові управління

Менеджмент

Основна робота: задавати питання і підводити підсумки

Пл’анування

Може бути стратегічне і тактичне

Організація

Домовитись про обмеження, ролі і те, як буде регламентуватися робота

;;; tern-lint.el --- JavaScript type-checker using Tern-lint and Flycheck.
;;; -*- lexical-binding: t -*-
;; Author: m.kobernyk@gmail.com
;; Author: katspaugh
;; Keywords: tools
;; URL: https://github.com/katspaugh/tern-lint.el
;; Version: 0.0.21
;; Package-Requires: ((emacs "26") (flycheck "2020.*") (tern "*"))
@mykhas
mykhas / backup.sh
Created March 11, 2018 14:37
IBM Cloud Object Storage backup script
#!/bin/bash
TOKEN=`bx iam oauth-tokens | sed -n 1p | awk 'NF>1{print $NF}'`
for FILENAME in ~/Documents/*.org; do
echo "$FILENAME"
curl -X PUT "https://s3.eu-geo.objectstorage.softlayer.net/org/$FILENAME" \
-H "authorization: Bearer $TOKEN" \
--data-binary @"$FILENAME"
done
@mykhas
mykhas / bad-practice.js
Created June 19, 2017 13:48
Inheritance in JS
function A(a) {
this.varA = a;
}
// What is the purpose of including varA in the prototype when A.prototype.varA will always be shadowed by
// this.varA, given the definition of function A above?
A.prototype = {
varA: null, // Shouldn't we strike varA from the prototype as doing nothing?
// perhaps intended as an optimization to allocate space in hidden classes?
// https://developers.google.com/speed/articles/optimizing-javascript#Initializing-instance-variables
@mykhas
mykhas / footer.html
Last active April 26, 2017 14:45 — forked from farasevych/index.html
nunjucks testing
fibie :: Integral a => a -> a
fibie a = case a of
0 -> 0
1 -> 1
n -> fibie (n - 1) + fibie (n - 2)
maximum' :: Ord a => [a] -> a
maximum' xs = case xs of
[] -> error "It's empty"
[x] -> x
sum' :: Num a => [a] -> a
sum' xs = case xs of
[] -> 0
(x:xs) -> x + sum' xs
initials :: String -> String -> String -- чому не працює String a => a -> a -> a
initials fn ln = [f] ++ " " ++ [l]
where (f:_) = fn
(l:_) = ln
lucky :: Integral a => a -> String
lucky 7 = "THAT'S SEVEN!"
lucky x = "Not a seven"
factorial :: Integral a => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)
addVectors :: Integral a => (a, a) -> (a, a) -> (a, a)
addVectors (x1, y1) (x2, y2) = ((x1 + x2), (y1 + y2))
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';