Skip to content

Instantly share code, notes, and snippets.

View jesusvazquez's full-sized avatar
👣
Leaving footprints all over

Jesus Vazquez jesusvazquez

👣
Leaving footprints all over
View GitHub Profile
#!/bin/bash
# shellcheck disable=SC2086
set -eou pipefail
_git_token="${GIT_TOKEN:-}"
repo_owner="${1:-}"
repo_name="${2:-}"
git_tag="${3:-}"
asset_filename="${4:-}"
@jesusvazquez
jesusvazquez / postgres-cheatsheet.md
Created May 11, 2019 19:35 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@jesusvazquez
jesusvazquez / .ideavimrc
Created August 28, 2018 21:05 — forked from bennyyip/.ideavimrc
idea vim plugin config
set hlsearch
set scrolloff=3
set ignorecase smartcase
set showmode
set history=1000
"" easy system clipboard copy/paste
"noremap <space>y "*y
"noremap <space>Y "*Y
"noremap <space>p "*p
@jesusvazquez
jesusvazquez / multiple-push-urls.md
Created July 31, 2018 12:43 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
@jesusvazquez
jesusvazquez / ctags.setup
Created September 11, 2017 20:16 — forked from nazgob/ctags.setup
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@jesusvazquez
jesusvazquez / reflect.py
Created July 27, 2017 03:41 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@jesusvazquez
jesusvazquez / sqlite3-cheat-sheet.md
Last active June 29, 2017 08:42 — forked from vincent178/sqlite3-cheat-sheet.md
sqlite3 cheat sheet

Vim Cheatsheet

Generally helpful stuff

Open a file for editing             :e path/to/file.txt
Return to Normal mode               ESC   or <CTRL>+C

Navigating around text