Skip to content

Instantly share code, notes, and snippets.

View felipeplets's full-sized avatar
🚀
Creating a better world, line by line.

Felipe Plets felipeplets

🚀
Creating a better world, line by line.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am felipeplets on github.
  • I am felipeplets (https://keybase.io/felipeplets) on keybase.
  • I have a public key whose fingerprint is 0AD8 408B D99E DEC4 E16E 104B 466E 5B11 EC75 F1CC

To claim this, I am signing this object:

@felipeplets
felipeplets / podforceupdate.sh
Created May 3, 2016 13:01 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@felipeplets
felipeplets / gist:aea47bb93e5a298a5fd5ff4de420e2ca
Created August 12, 2016 17:19
Open two instances of Unity or Mono IDEs on macOS
Run the following commands on your terminal:
/Applications/Unity/Unity.app/Contents/MacOS/Unity
/Applications/Unity/MonoDevelop.app/Contents/MacOS/monodevelop
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
@felipeplets
felipeplets / loader.bash
Last active July 3, 2019 15:29 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@felipeplets
felipeplets / promiseWillFail.js
Created August 28, 2019 19:59
Error handling in JS promises
// Assuming I just want to console.log the error message
await promiseWillFail().catch((err) => console.log(err.message));
@felipeplets
felipeplets / Script to clone multiple repositories and npm install
Created May 5, 2020 11:25
Shell script using GitHub CLI (gh) to download multiple repositories and run npm ci
USER=githubuser; PREFIX=secret-; REPOS=('proj1' 'proj2' 'proj3') && for REPO in ${REPOS}; do gh repo clone ${USER}/${PREFIX}${REPO} && cd ${PREFIX}${REPO} && npm ci && cd ..; done
# Install JQ
brew install jq
# Format JSON file
jq . input.json > output.json
@felipeplets
felipeplets / rename-branch.sh
Created July 17, 2020 00:31
Change master branch name to main
git branch -m master main
git push -u origin main
# Access your GitHub repo seetings and change the default branch to main
# Access the branch list and delete the branch master
# Remember to rename other files and CI/CD commands
@felipeplets
felipeplets / jsBenchIt.json
Created August 29, 2021 02:17
Double-await effect
{"title":"Double-await effect","initialization":"async function sleep() {\n return new Promise(resolve => setTimeout(resolve, 1))\n}","setup":"// runs before each test","tests":[{"name":"Double-await","code":"async function test() {\n return await sleep()\n}\n(async () => await test())() ","results":{"aborted":false,"count":15251,"cycles":3,"hz":108334.57519549297,"stats":{"moe":9.613797293851013e-7,"rme":10.415066458449294,"sem":4.904998619311742e-7,"deviation":0.0000030631706559748736,"mean":0.000009230663416508259,"variance":9.383014467625536e-12,"numSamples":39},"times":{"cycle":0.14077684776516744,"elapsed":10.969,"period":0.000009230663416508259,"timeStamp":1630203291246}},"platforms":{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.78":{"aborted":false,"count":24400,"cycles":3,"hz":190763.63636363644,"stats":{"moe":1.1983958554675582e-7,"rme":2.2861035119210227,"sem":6.114264568712032e-8,"deviation":4.009391403064