Skip to content

Instantly share code, notes, and snippets.

View nij4t's full-sized avatar
🐳
︵ 📦

Nijat Mahmudov nij4t

🐳
︵ 📦
View GitHub Profile
@nij4t
nij4t / iterm2-solarized.md
Created April 27, 2019 20:16 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@nij4t
nij4t / .zshrc
Created May 4, 2019 18:21
powerlevel9k theme
export ZSH="/home/displac3r/.oh-my-zsh"
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs vi_mode)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
plugins=(
git
@nij4t
nij4t / .vimrc
Created May 4, 2019 19:01
vim with powerline
set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256
set number
@nij4t
nij4t / .tmux.conf
Last active May 4, 2019 19:25
tmux with powerline
set -g default-command /usr/bin/zsh
source ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"
@nij4t
nij4t / .zshrc
Last active July 27, 2019 08:56
oh-my-zsh config
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='nerdfont-complete'
#POWERLEVEL9K_MODE='Noto Mono for Powerline'
#POWERLEVEL9K_MODE='DejaVuSansMono NF'
POWERLEVEL9K_CUSTOM_DISTRO_ICON="echo ' '"
POWERLEVEL9K_CUSTOM_DISTRO_ICON_BACKGROUND=000
POWERLEVEL9K_CUSTOM_DISTRO_ICON_FOREGROUND=040
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_distro_icon context dir dir_writable vcs vi_mode)
kubectl get po -l app=sonarqube -ojson | jq '.items | sort_by(.metadata.creationTimestamp) | .[-1].metadata.name'
@nij4t
nij4t / index.tsx
Last active July 30, 2020 22:39
Preact + ReduxZero + TypeScript w/ persistent state
import { BoundActions } from "redux-zero/types/Actions";
import { Provider, connect } from "redux-zero/preact"
import createStore from "redux-zero";
import { h, render, Fragment } from 'preact'
interface ConterState {
count: number;
}
export const setCount = (state: ConterState, count: number) => ({
// Use two pointers, walker and runner.
// walker moves step by step. runner moves two steps at time.
// if the Linked List has a cycle walker and runner will meet at some
// point.
public boolean hasCycle(ListNode head) {
if(head==null) return false;
ListNode walker = head;
ListNode runner = head;
while(runner.next!=null && runner.next.next!=null) {
@nij4t
nij4t / throttle.sh
Last active August 10, 2020 13:12
Ingress Traffic Throttling
########## downlink #############
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:
/sbin/tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's