Skip to content

Instantly share code, notes, and snippets.

View myshov's full-sized avatar
🚲
bycyle mood

Alexander Myshov myshov

🚲
bycyle mood
View GitHub Profile
@myshov
myshov / Car.spec.ts
Created March 5, 2021 16:12 — forked from armueller/Car.spec.ts
Typeguard Transparency Helper Example
import { isType } from './typeguardHelper';
import { Car, carRuleSet, Engine, engineRuleSet, Wheel, wheelRuleSet } from './Car';
const mockEngine: Engine = {
cylinders: 8,
maxSpeed: 7400,
fuelType: 'diesel'
};
const mockWheel: Wheel = {
@myshov
myshov / startwork.sh
Last active April 10, 2022 09:16
Start tmux session
tmuxSessionWork="work"
tmux start-server
tmux new-session -d -s $tmuxSessionWork -n vim
tmux new-window -t $tmuxSessionWork:2 -n ssh
tmux selectp -t 1
tmux send-keys "cd projects" C-m
tmux splitw -h -p 50
tmux new-window -t $tmuxSessionWork:3 -n bash
tmux select-window -t $tmuxSessionWork:1
tmux attach-session -t $tmuxSessionWork
@myshov
myshov / codemodes_talk_links.md
Last active April 10, 2022 09:16
Codemodes Talk (outdated)
@myshov
myshov / codemodes_talk_links.md
Last active May 26, 2019 11:13
Codemodes talk
@myshov
myshov / gist:bb9e5e14f4bbd852318e12347c1591eb
Created August 4, 2018 17:15
Awesome linter errors for awesome-machine-learning-on-source-code
README.md:1:1
✖ 1:1 Missing Awesome badge after the main heading awesome/badge
✖ 13:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 14:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 15:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 16:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 17:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 18:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
✖ 19:5 Incorrect indentation before bullet: remove 2 spaces list-item-bullet-indent
@myshov
myshov / prepack-gentle-intro-1.md
Created May 11, 2018 06:55 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@myshov
myshov / function_invocation.js
Last active January 21, 2024 15:14
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@myshov
myshov / parsing.lhs
Created January 31, 2016 17:29
Functional parsing library from chapter 8 of Programming in Haskell for new versions of GHCI
Functional parsing library from chapter 8 of Programming in Haskell,
Graham Hutton, Cambridge University Press, 2007.
> module Parsing where
>
>
> import Data.Char
> import Control.Monad
> import qualified Control.Applicative as CA
@myshov
myshov / generatorAccost.js
Created November 28, 2015 17:15
Javascript generator, simple example
// Generator can be helpful for linearizing async logic.
// It allows you to "pause" code execution with "yield"
// and run to the next "yield" or end of generator with "next"
function* helloGen() {
// 1: 2:
var str = yield ' bro';
// 3:
console.log(str);
}
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes