Skip to content

Instantly share code, notes, and snippets.

View xamfy's full-sized avatar
🏄‍♂️

Pratyaksh xamfy

🏄‍♂️
View GitHub Profile
@xamfy
xamfy / gh-cli-setup.sh
Created May 10, 2024 14:15
github cli
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
@xamfy
xamfy / caddy-setup.sh
Created May 10, 2024 13:46
caddy-setup
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
@xamfy
xamfy / postgres-cheatsheet.md
Created August 13, 2023 13:29 — 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)
@xamfy
xamfy / response.json
Last active May 17, 2021 13:49
response
{
"version": "v1.0",
"screens": [
{
"type": "FormFragment",
"fields": [
{
"id": "tf1",
"text": "First Name",
"placeholder": "First Name",
@xamfy
xamfy / iterm2-solarized.md
Created October 1, 2020 09:32 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@xamfy
xamfy / tmux.conf
Created September 26, 2020 16:22 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@xamfy
xamfy / .tmux.conf
Created September 26, 2020 16:21 — forked from rsp/.tmux.conf
The best and greatest tmux.conf ever - improved!
# The best and greatest tmux.conf ever - improved!
# https://gist.github.com/rsp/f4770a1fe8ea7e2378ac3a16e01a2b53
# Here are some customizations done by Rafał Pocztarski:
# use Ctrl+Backslash instead of Ctrl+A or Ctrl+B
# use Slash to split vertically
# use Backslash to split horizontally
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix
@xamfy
xamfy / delete_on_exit_temp_folder.sh
Created September 22, 2020 17:11 — forked from Sidd-Dino/delete_on_exit_temp_folder.sh
folder which deletes itself when you leave it
#!/usr/bin/env bash
#This script was made on a request from one of my human
# friends. He needed a folder that would delete itself when
# leaves it.
#
# Press Ctrl+d to leave the folder and let it delete itself
#time used to creaate uniques folders
time=$(printf "%(%l%M%S)T\\n" "-1")
@xamfy
xamfy / init.vim
Created September 16, 2020 17:16
neovim configuration
" vim:foldmethod=marker:foldlevel=0
" vim-plug {{{
call plug#begin()
" color scheme
Plug 'chriskempson/base16-vim'
" syntax highlighting
Plug 'peterhoeg/vim-qml'
@xamfy
xamfy / lazy-load-nvm.sh
Created August 31, 2020 05:08
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.