Skip to content

Instantly share code, notes, and snippets.

View AZaviruha's full-sized avatar

Alexei Zaviruha AZaviruha

  • Nikolaev, Ukraine
View GitHub Profile
@AZaviruha
AZaviruha / vim-multiline-comment.md
Created April 6, 2023 07:38 — forked from ultim8k/vim-multiline-comment.md
(un) comment multiple lines vim

From: http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim

For those tasks I use most of the time block selection.

Put your cursor on the first # character, press Ctrl``V (or Ctrl``Q for gVim), and go down until the last commented line and press x, that will delete all the # characters vertically.

For commenting a block of text is almost the same: First, go to the first line you want to comment, press Ctrl``V, and select until the last line. Second, press Shift``I``#``Esc (then give it a second), and it will insert a # character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/# in the second step instead.

@AZaviruha
AZaviruha / LLPSI.md
Created June 28, 2020 15:22 — forked from nahsi/LLPSI.md
Study guide

LINGVA LATINA PER SE ILLVSTRATA

LLPSI

Что есть LLPSI?

Lingua Latina per se Illustrata (сокращенно LLPSI или иллюстрата) — это серия книг за авторством Ханса Эрберга (Hans Ørberg) — датского лингвиста-латиниста, посвятившего большую часть своей жизни обучению английскому, французскому и латинскому языкам.

Курс LLPSI состоит из нескольких книг, ядром которых являются Pars I: Familia Romana и Pars II: Roma Aeterna. В отличии от традиционного, т.н. грамматического подхода к изучению языка, Ханс использует натуральный метод — метод погружения. Обе книги написаны полностью на латинском языке. Повествование начинается с простых предложений, понятных любому носителю языка индоевропейской семьи:

@AZaviruha
AZaviruha / main.md
Created June 4, 2020 06:41 — forked from hediet/main.md
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@AZaviruha
AZaviruha / better-nodejs-require-paths.md
Created July 16, 2018 06:07 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@AZaviruha
AZaviruha / richhickey.md
Created April 18, 2018 06:51 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@AZaviruha
AZaviruha / Jenkinsfile
Created April 9, 2018 12:27 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@AZaviruha
AZaviruha / tmux-cheatsheet.markdown
Created January 9, 2018 06:43 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- halLink: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "a Hypertext Application Language link",
@AZaviruha
AZaviruha / Main.elm
Created July 25, 2017 12:06 — forked from mdemin914/Main.elm
example of fetching data with elm and remote data
module Main exposing (..)
import RemoteData exposing (WebData, RemoteData(..), asCmd, fromTask)
import Html exposing (Html, text, div, input, br)
import Html.Events exposing (onClick)
import Html.Attributes exposing (type_, value)
import Http exposing (get, toTask)
import Json.Decode exposing (Decoder, string)
import Json.Decode.Pipeline exposing (decode, required)
import Random exposing (int, generate)
@AZaviruha
AZaviruha / README.md
Created May 25, 2017 17:40 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output