Skip to content

Instantly share code, notes, and snippets.

@RB-Lab
RB-Lab / 0-linux-hacks.md
Last active Dec 10, 2021
My Tweaks and Hacks for Linux
View 0-linux-hacks.md

Install & configure OhMyZSH & vim

See here

Make Gnome Terminal open new tab in the same directory

Go to PreferencesProfile [default profile]Command

  1. Check "Run command as a login shell"
  2. Select "Preserve working directory: always"

Hide Dock

See this my answer on Ask Ubuntu. Ans also you need to set to false "Extend height" to minimize Dock when "Activities" activated

@RB-Lab
RB-Lab / test-task.md
Last active Aug 5, 2020
Enapter junior frontend test task
View test-task.md

Enapter junior frontend test task

Create a registration form with the following fields:

  • User name (must be longer than 3 characters, only latin letters allowed, starts with capital letter)
  • Email (must be a valid email)
  • Phone number (must be a valid phone number; hyphens and parentheses for city code allowed)
  • Password (must be longer than 6 characters, must include digits, upper and lower case letters, may include special characters (!@#$%^&*()}{><>}) but must not include spaces or non-latin unicode characters)
  • Password repeat (must be the same as Password)
@RB-Lab
RB-Lab / ts-utils.ts
Created Jul 17, 2020
usefull small utils for TS
View ts-utils.ts
export function notEmpty<TValue>(
value: TValue | null | undefined
): value is TValue {
return value !== null && value !== undefined;
}
export type Maybe<T> = null | undefined | T;
export function filterMaybeArrayMaybe<T>(array: Maybe<Maybe<T>[]>) {
@RB-Lab
RB-Lab / boxes.css
Last active Sep 13, 2018
Space craft shop demo: You can copy-paste js to you chrome console → sources → snipets, hit cmd+enter and play around!
View boxes.css
.box {
margin: 10px;
height: 50px;
width: 50px;
display: inline-block;
}
.rocket {
background: url(http://www.rockybytes.com/i/924/mp3-rocket.jpg);
}
@RB-Lab
RB-Lab / VSCode Settings
Last active Dec 4, 2018
Settings for VSCode
View VSCode Settings
Settings for VSCode
@RB-Lab
RB-Lab / live-templates.md
Last active Apr 18, 2017
Live templates for InteliJ Idea JavaScript files (you can copy them and paste into according templates "folder")
View live-templates.md

unit-tests

<template name="dsc" value="describe('$text$', () =&gt; {&#10;    $end$&#10;});" description="describe for tests suites" toReformat="false" toShortenFQNames="true">
  <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
  <variable name="end" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="JS_STATEMENT" value="true" />
  </context>
</template>
@RB-Lab
RB-Lab / aliases.sh
Created Jan 17, 2017
Useful aliases for .zshrc/.bashrc
View aliases.sh
alias untgz="tar -xvzf"
alias hg="history | grep "
alias git-clear="git branch -d $(git branch --merged)"
alias lsl="ls -l"
@RB-Lab
RB-Lab / .eslintrc
Last active Jan 16, 2016
RB-Labs shiny .eslintrc [work in progress]
View .eslintrc
{
"env": {
"es6": true,
"browser": true
},
"rules": {
"comma-dangle": [2, "never"],
"indent": [1, "tab"],
"no-cond-assign": 1,
"no-console": 1,
@RB-Lab
RB-Lab / karma.conf.js
Created Nov 30, 2015
Minimal Karma config for use with React & Babel & Browserify
View karma.conf.js
// you need to $ npm i -D babel-preset-es2015 babel-preset-react babel-preset-stage-0 babelify karma karma-browserify karma-chai karma-mocha karma-mocha-reporter karma-phantomjs-launcher phantomjs-polyfill array.from
module.exports = function conf(config) {
config.set({
frameworks: ['browserify', 'mocha', 'chai'],
plugins: [
'karma-browserify',
'karma-mocha',
'karma-chai',
'karma-phantomjs-launcher',
View scripts.json
{
"scripts": {
"clean": "rimraf lib",
"test": "karma start --single-run",
"tdd": "karma start",
"check": "npm run lint && npm test",
"build": "babel --ignore __tests__ src --out-dir lib",
"lint": "eslint src",
"preversion": "npm run clean && npm run check",
"version": "npm run build",