Skip to content

Instantly share code, notes, and snippets.

View felipepodesta's full-sized avatar
👨‍💻
Stairway To Heaven

Felipe Podestá felipepodesta

👨‍💻
Stairway To Heaven
View GitHub Profile
@MyElectricSheep
MyElectricSheep / main.yml
Created February 23, 2021 15:45
Yml file for GitHub Pages React App Deployment
# This is a workflow to auto-deploy you React app with secrets
# https://github.com/marketplace/actions/deploy-to-github-pages
name: Deploy & Build React App
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
@felipepodesta
felipepodesta / functions.sh
Created February 9, 2021 16:04 — forked from rkennesson/functions.sh
bash functions
# __ _ _
# / _|_ _ _ __ ___| |_(_) ___ _ __ ___
# | |_| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
# | _| |_| | | | | (__| |_| | (_) | | | \__ \
# |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
#
# ▓▓▓▓▓▓▓▓▓▓
# ░▓ author ▓ cirrus <[email protected]>
# ░▓ code ▓ https://gist.github.com/cirrusUK
# ░▓ mirror ▓ http://cirrus.turtil.net
@craftslab
craftslab / clean.sh
Last active November 16, 2021 03:04
ubuntu clean
#!/bin/bash
rm -rf $HOME/.cache/thumbnails/*
sudo apt-get autoremove --purge
sudo apt-get clean
sudo journalctl --disk-usage
sudo journalctl --vacuum-time=1s
sudo journalctl --disk-usage
@faahmad
faahmad / ci-react-firebase.yaml
Created January 13, 2021 01:44
GitHub Actions Workflow for a React x Firebase app (includes Cloud Functions, Preview Channels)
# https://twitter.com/farazamiruddin
# My GitHub Actions workflow for pull requests. Feel free to use this as inspiration.
name: CI React Firebase
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
@javiermarinros
javiermarinros / preload.php
Last active September 12, 2023 00:27
Opcache preload for core WordPress 5.6 classes and functions
<?php
function is_preloaded(): bool
{
return true;
}
// WordPress
define('ABSPATH', __DIR__ . '/');
define('WPINC', 'wp-includes');
@Jkotheimer
Jkotheimer / run.sh
Created December 19, 2020 01:55
A deployment mechanism for Docker-based web servers.
#!/usr/bin/env bash
# run.sh
#
# @author: Jack Kotheimer
# @date: 12/5/2020
#
# The main functionality of the script is listed just below in the '_help' function, but if you have any questions about
# the functionality or implementation of this script, feel free to send me a message via email at [email protected]
#
# Enjoy!
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 22, 2025 17:41
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@felipepodesta
felipepodesta / postgres-cheatsheet.md
Created December 1, 2020 18:12 — 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)
@kudosqujo
kudosqujo / basics.sh
Last active September 22, 2021 00:25
[AWS CLI] #aws #cheatsheet #ec2 #s3 #eks
### Walkthrough #1: Create our first virtual machine in the cloud
# get list of commands useful for EC2
aws ec2 help | grep "\sdescribe"
# create an SSH keypair for AWS
aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem
# verify that AWS knows about our newly created key
aws ec2 describe-key-pairs --key-name MyKeyPair
@simonfongnt
simonfongnt / ubuntucleanupspace.sh
Last active November 16, 2021 03:24
ubuntu clean up space
rotate the files first so that recent entries are moved to inactive files
journalctl --rotate
Retain only the past two days:
journalctl --vacuum-time=30d
Retain only the past 500 MB:
journalctl --vacuum-size=500M