Skip to content

Instantly share code, notes, and snippets.

View roziscoding's full-sized avatar
🏳️‍🌈

Roz roziscoding

🏳️‍🌈
View GitHub Profile
@roziscoding
roziscoding / .preview
Last active July 3, 2023 13:54
WSL/ubuntu dotfiles
#! /usr/bin/env zsh
realpath=${1:-$2}
batcommand=$(if type batcat > /dev/null; then echo 'batcat'; else echo 'bat'; fi)
if [[ ! -r $realpath ]]; then
where $realpath;
elif [[ -d $realpath ]]; then
exa -1 -lah --git --icons --color=always --octal-permissions --no-time --no-permissions --group-directories-first -s name $realpath;
elif [[ $realpath:t:e = "png" || $realpath:t:e = "jpg" ]]; then
@roziscoding
roziscoding / deploy.mjs
Created March 15, 2022 23:53
zx script for zero downtime docker compose deployment
#!/usr/bin/env zx
const SERVICE_NAME = 'community-api-public';
const reloadNginx = () =>
quiet($`docker compose exec nginx /usr/sbin/nginx -s reload > /dev/null`);
const trim = (promise) =>
promise.then((result) => result.stdout).then((output) => output.trim());
const getHealthStatus = (id) =>
" SETTINGS ----------------------------------------------------------- {{{
" Disable compatibility with vi which can cause unexpected issues.
set nocompatible
" Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on
" Enable plugins and load plugin for the detected file type.
filetype plugin on
" Load an indent file for the detected file type.
filetype indent on
echo "Installing curl"
sudo apt install curl
echo "Installing git"
sudo apt install git
echo "Installing xclip"
sudo apt install xclip
echo "Installing zinit"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)"
echo "Installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Adds `brew` to PATH
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Fixing completions

Keybase proof

I hereby claim:

  • I am roziscoding on github.
  • I am roziscoding (https://keybase.io/roziscoding) on keybase.
  • I have a public key whose fingerprint is 6C59 D01E 490C B533 6D3A A070 C60E 898E 61D6 AE2F

To claim this, I am signing this object:

@roziscoding
roziscoding / convert.ts
Created March 12, 2019 20:00
Unit converting with pure functions and a factory
export const fromCToK = (value: number) => value * 1.8 + 32
export const fromCToF = (value: number) => value + 273.15
export const fromFToC = (value: number) => (value - 32) / 1.8
export const fromFToK = (value: number) => fromFToK(value) + 273.15
export const fromKToC = (value: number) => value - 273.15
export const fromKToF = (value: number) => (value * 1.8) - 459.67
export const convert = (value: number) => ({

Keybase proof

I hereby claim:

  • I am rjmunhoz on github.
  • I am rjmunhoz (https://keybase.io/rjmunhoz) on keybase.
  • I have a public key ASDarSAtuZhNxewvU7V_X4WzEErg-49yv_9r_xsMAeI_LQo

To claim this, I am signing this object:

@roziscoding
roziscoding / README.md
Last active March 27, 2020 16:49
front-end fancy console log messages

Fancy console log functinos

Usage:

Just call the common log type functions:

info('Informando algo');
debug('Informação muito relevante pra debugar');
error('Errinho aqui em');
@roziscoding
roziscoding / INSTALL.md
Created September 5, 2017 15:02
Safe merge script

git clone