Skip to content

Instantly share code, notes, and snippets.

@prkstaff
prkstaff / init.vim
Last active December 14, 2023 17:34
" close buffer without closing window using leader q
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" nice indent for yaml files:
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
"
" nice indent for html files:
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
@prkstaff
prkstaff / init.vim
Last active October 26, 2022 20:37
My Init.vim
" close buffer without closing window using leader q
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" nice indent for yaml files:
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
"
" nice indent for html files:
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
" spell checks
@prkstaff
prkstaff / .tmux.conf
Created July 12, 2019 14:14
tmux, bind key H
unbind C-b
set-option -g prefix C-h
bind-key C-h send-prefix
@prkstaff
prkstaff / wait_ctrl_c.sh
Created June 27, 2019 18:52
Bash script wait untill user press ctrl+c
#!/bin/bash
trap ctrl_c INT
function ctrl_c()
{
echo "Trap: CTRL+C received, exit"
exit
}
@prkstaff
prkstaff / solution_unique_paths_grid.py
Created June 7, 2017 18:04
Unique Paths in a Grid
import copy
#Unique Paths in a Grid
#only X,Y+1 and X+1,y movements allowed
# -1 is obstacle
class Solution:
def get_number_of_possible_paths(self, list_of_rows):
potencial_list = copy.copy(list_of_rows)
lo = list_of_rows
@prkstaff
prkstaff / solution.py
Created June 6, 2017 19:23
longest subsequence printing a sequence given a tuple of number
class Solution:
def get_longest_subsequence(self, tupl):
sequence_counter = []
longest_sequence = 1;
for i,ivalue in enumerate(tupl):
sequence_counter.insert(i,1)
for j in reversed(range(i)):
print "============"
print "Turn: I {0} and J {1}".format(tupl[i],tupl[j])
print "I has index {0}".format(sequence_counter[i])
@prkstaff
prkstaff / init.vim2
Last active February 16, 2017 23:31
init.vim for c++, javascript, and python
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "c,html,javascript,python,ruby"
@prkstaff
prkstaff / .bash_profile
Created December 15, 2016 19:10
My bash_profile - colored Iterm2
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
@prkstaff
prkstaff / init.vim
Last active September 13, 2023 20:27
My NeoVim config + Dracula theme + NerdTree
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "javascript,php,python,ruby"