Skip to content

Instantly share code, notes, and snippets.

View ricardoaugusto's full-sized avatar
🥽
Focusing

Ricardo Augusto ricardoaugusto

🥽
Focusing
View GitHub Profile
@ricardoaugusto
ricardoaugusto / git-forget.sh
Last active April 14, 2024 20:14
Git commands (I keep forgetting)
# REMOTE
git remote -v # to list the remotes
git remote set-url origin new-remote-url # change the url
git remote rename origin new-remote-name # change the remote name
# DELETE BRANCH
git branch -D some-branch # local
git push origin --delete remote_branch_name # remote
# RENAME BRANCH
@ricardoaugusto
ricardoaugusto / fix.sh
Created February 2, 2024 10:21
Laravel Valet: fix "Unable to determine linked PHP when parsing 8.3"
brew unlink php
valet use [email protected] #or another version
brew services restart --all
composer global update
valet start
@ricardoaugusto
ricardoaugusto / package.json
Created February 2, 2024 10:19
Fixes ERR_OSSL_EVP_UNSUPPORTED when running Nuxt 2 on Node.js > 17 on macOS
"scripts": {
"dev": "nuxt",
"build": "nuxt --openssl-legacy-provider build",
"start": "nuxt --openssl-legacy-provider start",
"generate": "nuxt --openssl-legacy-provider generate",
"lint:js": "eslint --ext \".js,.ts,.vue\" --ignore-path .gitignore .",
"lint:prettier": "prettier --check .",
"lint": "npm run lint:js && npm run lint:prettier",
"lintfix": "prettier --write --list-different . && npm run lint:js -- --fix"
},
@ricardoaugusto
ricardoaugusto / package.json
Created February 2, 2024 10:00
Fixes ERR_OSSL_EVP_UNSUPPORTED when running vue-cli-service on Node.js > 17 on macOS
"scripts": {
"start": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint"
}
@ricardoaugusto
ricardoaugusto / .zshrc
Created March 20, 2023 16:38
macOS Homebrew Python 3 (2023 update)
export PATH="$(brew --prefix)/opt/python@3/libexec/bin:$PATH"
@ricardoaugusto
ricardoaugusto / gist:20c01065d8e4dc104aa891854f44b2ab
Created January 30, 2023 15:03
Install PHP 7.4 on macOS with Homebrew
brew tap shivammathur/php
brew install shivammathur/php/[email protected]
brew link [email protected]
@ricardoaugusto
ricardoaugusto / git-reset-hard-push-force.sh
Created November 4, 2022 18:27
Resets a commit and push --force
#!/bin/bash
# usage: sh git-reset.sh -h someCommitHash -t some/feature-branch
while getopts h:t: flag
do
case "${flag}" in
h) hashed=${OPTARG};;
t) target=${OPTARG};;
esac
done
@ricardoaugusto
ricardoaugusto / typescript-crash.ts
Created July 31, 2022 17:29 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@ricardoaugusto
ricardoaugusto / ray+sail.md
Created July 21, 2022 01:14
Spatie Ray + Laravel Sail

How to get Ray running with Laravel Sail

sail composer require spatie/laravel-ray --dev
sail artisan ray:publish-config --docker

Update .env