Skip to content

Instantly share code, notes, and snippets.

View niosus's full-sized avatar
🇺🇦
Save Ukraine

Igor Bogoslavskyi niosus

🇺🇦
Save Ukraine
View GitHub Profile
@niosus
niosus / .zshrc
Last active March 19, 2023 13:46
Zsh config
# Init antigen.
source "$HOME/.antigen.zsh"
# Configure antigen.
antigen use oh-my-zsh
# Plugins
antigen bundle git
antigen bundle command-not-found
antigen bundle zsh-users/zsh-completions
@niosus
niosus / to_gif.sh
Last active February 5, 2020 11:43
High quality gif from video or images
#!/bin/bash
FPS=10 # Default value, is updated later on.
WIDTH=900 # Default value, is updated later on.
COLORS=256 # Default value, is updated later on.
OUTPUT=''
VIDEO=''
IMAGE_MASK=''
BASE_INPUT_NAME=''
SPEED='1'
OVERWRITE=''
@niosus
niosus / #deg-guards.sublime-snippet
Last active March 1, 2020 00:19
Define guards snippet for Sublime Text 3
<snippet>
<description>#def_guards_formatted</description>
<content><![CDATA[#ifndef ${TM_FILEPATH/(?:^\/*[\w\/]*\/(?:src|include)\/(\w+))|(?:^\/*[\w\/]*\/(\w+)\/(?:\2))|(?:^\/*home\/${TM_FULLNAME}\/(\w+))|(?:\/([\w_]+))|(?:\.(h))/\U$1$2$3$4$5$6_\E/g}
#define ${TM_FILEPATH/(?:^\/*[\w\/]*\/(?:src|include)\/(\w+))|(?:^\/*[\w\/]*\/(\w+)\/(?:\2))|(?:^\/*home\/${TM_FULLNAME}\/(\w+))|(?:\/([\w_]+))|(?:\.(h))/\U$1$2$3$4$5$6_\E/g}
${0:$SELECTION}
#endif // ${TM_FILEPATH/(?:^\/*[\w\/]*\/(?:src|include)\/(\w+))|(?:^\/*[\w\/]*\/(\w+)\/(?:\2))|(?:^\/*home\/${TM_FULLNAME}\/(\w+))|(?:\/([\w_]+))|(?:\.(h))/\U$1$2$3$4$5$6_\E/g}
]]></content>
<tabTrigger>def</tabTrigger>
<scope>source.c, source.c++, source.objc, source.objc++</scope>
</snippet>
@niosus
niosus / builder_pattern.cpp
Created July 4, 2016 14:08
An example of builder pattern in c++
#include <stdio.h>
#include <memory>
class BBuilder;
class A {
public:
A() {}
virtual ~A() { fprintf(stderr, "A done.\n"); }
int getA() const { return _a; }