Skip to content

Instantly share code, notes, and snippets.

View romgrk's full-sized avatar
♥️
hey

Rom Grk romgrk

♥️
hey
View GitHub Profile

Keybase proof

I hereby claim:

  • I am romgrk on github.
  • I am romgrk (https://keybase.io/romgrk) on keybase.
  • I have a public key whose fingerprint is A22C A800 18BD 08B1 5AD8 8ED3 0EC3 402D 7145 2474

To claim this, I am signing this object:

export ALIASES="$HOME/.aliases'
# CMD and UNCMD are permanent alias
function cmd () {
if [[ $# == 1 ]]; then
print $(alias_value $1)
return 0
fi
if [[ -w $ALIASES ]]; then
ZSH_ALIASES=${ZSH_ALIASES:-"$HOME/.aliases"}
# CMD and UNCMD are permanent alias
# FIXME: multiple 'cmd' create multiple entries (but only the last is sourced)
# 'uncmd' remove all entries
function cmd () {
if [[ $# == 0 ]]; then
sed -n '/^alias/ p' <$ZSH_ALIASES
return 0
elif [[ $# == 1 ]]; then
awk '
" If someone ever needs:
" Colors convertion library:
" Hex, RGB, HSL
" it was all made for
" func color#darken( hex:String, amount:[String | Number | Float] ) and
" func color#lighten( hex:String, amount:[String | Number | Float] )
" where r,g,b ∈ [0, 255]
@romgrk
romgrk / hi.vim
Last active February 12, 2016 11:28
" !::exe [so %]
" Author: romgrk
" Description: hightlight helpers
" Date: 07 Oct 2015
" this is the README:
" highlight autoload function very handy for scripting the syntax-hl
" hi#fg and hi#bg ('GoupName' [, color:String])
" are both getter and setters
" hi#( name [, group:[] | fg [,bg [,attr ] ] ] )
" File: definition.vim
" Author: romgrk
" Date: 13 May 2016
" Description: Jump where the given expression was last set.
" !::exe [so %]
command! -nargs=* -complete=expression Goto call <SID>goto(<q-args>)
" Example mappings:
" nmap <leader>gc :Goto command<space>
" Author: romgrk | License: JSON-like
" This SHOULD (RFC 2119) go in a $RUNTIME/ftplugin/vim/ directory.
" (personnally I have it in $RUNTIME/after/ftplugin/vim.vim)
" Alt+i in insert mode in vimscript files inserts the next keystroke as vim-notation
" - there are some special keys: e.g.
" <A-i><S-,> inserts '<lt>' literally
" <A-i>i inserts '<SID>' literally
" <A-i>b inserts '<buffer>' literally
" Gothik functions "{{{
function! Gothik (string)
let result = ''
let len = len(a:string)
let n = 0
while (n < len)
let result .= s:gothik(a:string[n])
let n += 1
endwhile
#!/bin/zsh
# Usage: $ savepull [dir]
#
# Default:
# dir = ./
#
# Updates the master branch of the specified git repository
# from upstream (aka origin/master), but handles dirty directory
# by stashing the state, switching to master, then coming back to
# the initial branch & pop-stashing automatically.
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.