Skip to content

Instantly share code, notes, and snippets.

View petronetto's full-sized avatar
🤖
What's up human?

Juliano Petronetto petronetto

🤖
What's up human?
View GitHub Profile
@petronetto
petronetto / ssm2env
Created July 31, 2023 11:09 — forked from naoty/ssm2env
Create .env file from SSM parameter store
#!/bin/bash -e
aws ssm get-parameters-by-path \
--path "/myapp/" \
--with-decryption \
--query "Parameters[*].[Name,Value]" \
--output text |
while read line
do
name=$(echo ${line} | cut -f 1 -d ' ' | sed -e 's/\/myapp\///g')
@petronetto
petronetto / read_dotenv_and_create_parameter_store_on_aws.sh
Created July 31, 2023 11:08 — forked from almerindo/read_dotenv_and_create_parameter_store_on_aws.sh
Bash script to read .env and creates parameter store on aws.
#! /bin/bash
ENVS=$(egrep -v '^#' .env | xargs)
ARRAY_ENVS=($(echo $ENVS | tr ' ' ' '))
prop="name"
APP_NAME="$(node -pe "require('./package.json')['$prop']")"
TOTAL="${#ARRAY_ENVS[@]}"
TOTAL=$((TOTAL - 1))
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.12.0|configurator
* you can change this configuration by importing this file.
*/
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
@petronetto
petronetto / nerd_fonts.sh
Created April 3, 2023 15:06 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
# Nerd Fonts for your IDE
# https://www.nerdfonts.com/font-downloads
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font
@petronetto
petronetto / .zshrc
Created January 27, 2023 13:10 — forked from bashbunni/.zshrc
CLI Pomodoro for Linux
# study stream aliases
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro
declare -A pomo_options
pomo_options["work"]="45"
pomo_options["break"]="10"
pomodoro () {
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
val=$1
@petronetto
petronetto / .vimrc
Created February 4, 2022 13:44 — forked from miguelgrinberg/.vimrc
My .vimrc configuration for working in Python with vim
" plugins
let need_to_install_plugins = 0
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let need_to_install_plugins = 1
endif
call plug#begin()
Plug 'tpope/vim-sensible'
@petronetto
petronetto / CustomerRepository.php
Created August 12, 2020 14:40
Dosctrine Generator
<?php declare(strict_types=1);
namespace My\Application\Repository;
class CustomerRepository extends Doctrine\ORM\EntityRepository
{
public function findAll()
{
$queryBuilder = $this->createQueryBuilder('c')
->select('c')
This file has been truncated, but you can view the full file.
{
"ABW":{
"name":{
"common":"Aruba",
"official":"Aruba",
"native":{
"nld":{
"official":"Aruba",
"common":"Aruba"
},
@petronetto
petronetto / split.sh
Created September 28, 2019 01:01
Bash Split String
#!/bin/bash
# usage: split.sh foo,bar
options=($(echo $1 | tr "," "\n"))
for i in "${options[@]}"
do
case $i in
"foo")
@petronetto
petronetto / tmux-cheat-sheet.md
Created September 26, 2019 11:09 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet