Skip to content

Instantly share code, notes, and snippets.

View lnikon's full-sized avatar

Vahag Bejanyan lnikon

View GitHub Profile
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
// ThreadSafeQueue
// ThreadPool
// 1. How to implement virtual functions

Keybase proof

I hereby claim:

  • I am lnikon on github.
  • I am nikkilanikki (https://keybase.io/nikkilanikki) on keybase.
  • I have a public key ASAzK47Hsj-y9dD_Vg64HkNjAr3QKS2VSaAsg0_Yq4gRvgo

To claim this, I am signing this object:

@lnikon
lnikon / .nvimrc
Created March 15, 2021 17:42
NeoVim config
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'sbdchd/neoformat'
Plug 'neoclide/coc.nvim'
Plug 'jackguo380/vim-lsp-cxx-highlight'
Plug 'lervag/vimtex'
Plug '/home/nikon/projects/chapel-1.22.1/highlight/vim'
@lnikon
lnikon / full-adder.py
Created March 9, 2021 15:59
Quantum Full Adder
from qiskit import QuantumCircuit, assemble, Aer
from qiskit.visualization import plot_histogram
A = 0
B = 1
XOR_A_B = 2
SUM = 4
CARRY_IN = 3
AND_A_B = 5
CARRY_OUT = 6
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'sbdchd/neoformat'
Plug 'neoclide/coc.nvim'
Plug 'jackguo380/vim-lsp-cxx-highlight'
Plug 'lervag/vimtex'
Plug '/home/nikon/projects/chapel-1.22.1/highlight/vim'
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <tuple>
#include <iterator>
#include <algorithm>
#include <numeric>
#include <random>
#include <iomanip>
@lnikon
lnikon / do-install-docker.sh
Created February 14, 2020 13:58 — forked from joshuaebowling/do-install-docker.sh
digital ocean installing docker
# instructions from https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
# Add the GPG key for the official Docker repository to the system
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# Add the Docker repository to APT sources:
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
# Update the package database with the Docker packages from the newly added repo:
sudo apt-get update
@lnikon
lnikon / patt_dfa.cpp
Created October 21, 2019 14:32
Programm that construct DFA tansitions table for a given pattern
#include <iostream>
#include <string>
#include <vector>
constexpr const std::size_t ALPHABET_SIZE = 26;
std::size_t next_state(const std::string& pattern, std::size_t current_state, char input_symbol)
{
if (current_state < pattern.length() && input_symbol == pattern[current_state])
{
@lnikon
lnikon / lhs.hs
Created April 23, 2019 14:25
learning_haskell1
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
lucky :: (Integral a) => a -> String
lucky 7 = "Lucky NUMBER Se7e"
lucky x = "Sorry, you're out of luck, pal!"