Skip to content

Instantly share code, notes, and snippets.

View gustavonecore's full-sized avatar
🛠️
I can kill two stones with one bird

Gustavo Delgado gustavonecore

🛠️
I can kill two stones with one bird
View GitHub Profile
@gustavonecore
gustavonecore / .bash_profile
Created August 24, 2018 21:09
Mac command alias for react native development
# Open your bash_profile and add these lines
alias react-native-reset-cache="react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"
alias react-native-release-debug="cd android && ./gradlew assembleDebug && cd ..;"
alias react-native-build-debug-apk="rm -f android/app/build/outputs/apk/app-debug.apk; react-native-reset-cache;react-native-release-debug;"
# Then, run > source /Users/{username}/.bash_profile
# At this point, you are ready to go. If you want to build a debug release, just type:
@gustavonecore
gustavonecore / mysql-gdrive.sh
Last active November 9, 2018 11:16
Mysql backup to Google Drive
1.- First of all, install the gdrive binary
https://github.com/prasmussen/gdrive
2.- Execute gdrive list
This will try to run the command, but since you don't have any credential, will prompt in the console an url to login. Go to that url in your browser, confirm the process and copy the given token.
3.- Paste the token in the command line
4.- Add new cron jobs as you need. Replace the {database} and {folderId} with your database name and gdrive folder id, like:
0 3 * * * /path/to/your/mysql-gdrive.sh {database} {folderId}
@gustavonecore
gustavonecore / bynary-tree.js
Created November 30, 2020 12:49
Binary Search Tree in Node
const DIREECTION = {
LEFT: 'LEFT',
RIGHT: 'RIGHT',
};
class Node {
constructor(data, parent = null) {
this.data = data;
this.parent = parent;
this.level = parent ? (parent.level + 1) : 1;
@gustavonecore
gustavonecore / docker-compose.yml
Last active August 13, 2021 22:11
Mysql docker compose setup
version: '3.3'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'db'
# So you don't have to use root, but you can if you like
MYSQL_USER: '{le-username}'
# You can use whatever password you like