Skip to content

Instantly share code, notes, and snippets.

@pazams
pazams / ideavim
Last active September 14, 2022 21:08
"" Source your .vimrc
source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
@pazams
pazams / gist:0006de61e6eacc7494282e3ace7e1b5e
Created December 18, 2021 22:17
docker logs of an app
```
$ sudo docker logs $(sudo docker ps | grep <app-name> | awk '{print $1;}')
```
// with permission and based on https://stackoverflow.com/a/23598731
package data
import (
"fmt"
"reflect"
"strings"
)
# Ag & Sed (w/ backup)
ag -0 -l . | xargs -0 sed -ri.bak -e 's/find/replace/g'
# Ag & Sed (w/o backup)
ag -0 -l . | xargs -0 sed -ri -e 's/find/replace/g'
# Perl
LC_ALL=en_US.UTF-8 perl -i -w -pe 's/old/new/g' $(find . -name \*.* -print)
# Perl (with multiline search)
@pazams
pazams / 00-README.md
Created June 7, 2017 23:11 — forked from guumaster/00-README.md
How to upload a file with $.ajax to AWS S3 with a pre-signed url

Upload a file with $.ajax to AWS S3 with a pre-signed url

When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.

Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.

So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).

" file yank
nmap fy :let @+ = expand("%")<CR>
" file-full yank
nmap ffy :let @+ = expand("%:p")<CR>
1. add to `~/.profile`:
export TERM='xterm-256color'
2. run neovim
NVIM_TUI_ENABLE_TRUE_COLOR=1 nvim -u ~/.vimrc
{
"libs": [
"browser",
"ecma5",
"ecma6"
],
"loadEagerly": [
"importantfile.js"
],
"plugins": {
@pazams
pazams / extra.vim
Last active June 18, 2016 17:12
my extra .vimrc settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => pazams opinionated- ‘d is for delete’ & ‘ leader-d is for cut’ (shared clipboard register mode)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" if you are using the yankring plugin, there could be some conflicts.
" to make the most of these suggested mappings,
" make sure to delete any keys mapped below from the following line at yankring.vim
" (i.e. delete 'x' and 'D'):
" let g:yankring_n_keys = 'Y D x X'