Skip to content

Instantly share code, notes, and snippets.

View rkenzhebekov's full-sized avatar

Ruslan Kenzhebekov rkenzhebekov

View GitHub Profile
#!/bin/bash
set -e
# Navigate to app directory
cd /home/<YOUR_USERNAME>/my_app
# Find the current release and the second newest release
current_release=$(ls ../releases | sort -nr | head -n 1)
previous_release=$(ls ../releases | sort -nr | tail -n +2 | head -n 1)
#!/bin/bash
set -e
# Update to latest version of code
cd /home/<YOUR_USERNAME>/my_app
git fetch
git reset --hard origin/main
mix deps.get --only prod
# Optional CI steps
@rkenzhebekov
rkenzhebekov / postgres-pivot.md
Created November 9, 2021 19:28 — forked from ryanguill/postgres-pivot.md
Example of postgres pivot using jsonb_object_agg for variable columns in output. To play with this yourself in an online repl, click here: http://dbfiddle.uk/?rdbms=postgres_9.6&fiddle=5dbbf7eadf0ed92f8d6a49fc5be8f3f2
/*
================================================================================
Pivot example with variable number of columns in the output.
================================================================================

example data is straight forward, imagine a table with a customer identifier, an invoice date and an amount.
*/

DROP TABLE IF EXISTS invoice;
@rkenzhebekov
rkenzhebekov / # libspatialite - 2018-12-22_23-11-38.txt
Created December 23, 2018 07:13
libspatialite on macOS 10.10.5 - Homebrew build logs
Homebrew build logs for libspatialite on macOS 10.10.5
Build date: 2018-12-22 23:11:38
@rkenzhebekov
rkenzhebekov / .gitconfig
Created March 24, 2016 17:37 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: