Skip to content

Instantly share code, notes, and snippets.

View santospatrick's full-sized avatar
👽
Javascripting

Patrick Santos Bitonti Teixeira santospatrick

👽
Javascripting
View GitHub Profile
@santospatrick
santospatrick / set-heroku-env-variables-from-bash.md
Last active May 14, 2024 17:48
Set heroku env variables programmatically
chmod +x set_heroku_env.sh
./set_heroku_env.sh
@santospatrick
santospatrick / firebase-indexes-import.md
Created May 6, 2024 14:54
Firebase export / import database indexes

this will select staging and export indexes

firebase use default
firebase firestore:indexes > firestore.indexes.json

then we need to import them in production, so we don't need to create all of them manually (could be 20+ and it takes some time)

firebase use production
firebase deploy --only firestore:indexes
@santospatrick
santospatrick / Nework_throttling_profiles.md
Created May 26, 2023 01:58 — forked from theodorosploumis/Nework_throttling_profiles.md
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
{"name":"Udemy Profile","settings":"{\"settings\":\"{\\n // Window\\n \\\"window.zoomLevel\\\": 1,\\n\\n // Editor\\n \\\"editor.cursorBlinking\\\": \\\"solid\\\",\\n \\\"editor.fontSize\\\": 14,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll.eslint\\\": true,\\n },\\n \\\"editor.detectIndentation\\\": true,\\n \\n // Workbench\\n \\\"workbench.editor.enablePreviewFromQuickOpen\\\": false,\\n \\\"workbench.editor.enablePreview\\\": false,\\n \\\"workbench.colorTheme\\\": \\\"Dracula\\\",\\n \\\"workbench.iconTheme\\\": \\\"material-icon-theme\\\",\\n\\n // Git Project Manager\\n \\\"gitProjectManager.openInNewWindow\\\": true,\\n \\\"gitProjectManager.checkRemoteOrigin\\\": false,\\n \\\"gitProjectManager.maxDepthRecursion\\\": 1,\\n \\\"gitProjectManager.baseProjectsFolders\\\": [\\n \\\"~/Developer\\\"\\n ],\\n \\\"gitProjectManager.ignoredFolders\\\": [\\n \\\"node_m
{"name":"Patrick's Profile","settings":"{\"settings\":\"{\\n // Workbench\\n \\\"workbench.startupEditor\\\": \\\"none\\\",\\n \\\"workbench.colorTheme\\\": \\\"Dracula\\\",\\n \\\"workbench.iconTheme\\\": \\\"material-icon-theme\\\",\\n \\\"workbench.editor.enablePreviewFromQuickOpen\\\": false,\\n \\\"workbench.editor.enablePreview\\\": false,\\n \\\"workbench.colorCustomizations\\\": {\\n \\\"statusBar.debuggingBackground\\\": \\\"#45C8FE\\\"\\n },\\n\\n // Editor\\n \\\"editor.cursorBlinking\\\": \\\"solid\\\",\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"editor.wordWrap\\\": \\\"on\\\",\\n \\\"editor.rulers\\\": [\\n 120\\n ],\\n \\\"editor.fontSize\\\": 14,\\n \\\"editor.detectIndentation\\\": true,\\n \\\"editor.acceptSuggestionOnCommitCharacter\\\": false,\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll.eslint\\\": true,\\n },\\n \\\"editor.quickSuggestionsDelay\\\": 100,\\n \\\"editor.accessibilitySupp
@santospatrick
santospatrick / exercises.tsx
Last active July 30, 2022 16:00
Typescript exercises based in real world examples
// ===================
// Typescript Exercises
// ===================
// Utility types: https://www.typescriptlang.org/docs/handbook/utility-types.html
// Reference: https://pokeapi.co/api/v2/pokemon?limit=10
type Pokemon = unknown
const bulbasaur: unknown = {
name: 'bulbasaur',
// .hyper.js
// See https://hyper.is#cfg for all currently supported options.
// After installing hyper, run the following:
// hyper i hyper-dracula hypercwd hyper-active-tab
module.exports = {
config: {
fontSize: 18,
fontFamily: '"Meslo LG M for Powerline", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
fontWeight: 'normal',
@santospatrick
santospatrick / setup-mac.sh
Last active April 21, 2023 15:59
MacOSX Setup for Development
#!/usr/bin/env bash
# 1. Run this script file
# bash <(curl -Ls https://bit.ly/3swaoUr)
# Homebrew & Apps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew update
@santospatrick
santospatrick / exercises.js
Last active September 7, 2021 21:10
Javascript simples immutable data structure exercises
// ===================
// Array Exercises
// ===================
// Reference: https://pokeapi.co/api/v2/pokemon?limit=10
const arr = [
{
name: 'bulbasaur',
url: 'https://pokeapi.co/api/v2/pokemon/1/',
base_experience: 64,