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 / 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
@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 / 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 / .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:
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@gustavonecore
gustavonecore / UploadAssetsComponent.js
Created March 26, 2018 14:30
components/common/UploadAssetsComponent.js
import React, { Component } from 'react';
import { Row, Grid, Col } from 'react-bootstrap';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField';
import FontIcon from 'material-ui/FontIcon';
import {List, ListItem} from 'material-ui/List';
import IconButton from 'material-ui/IconButton';
import moment from 'moment';
@gustavonecore
gustavonecore / TransactionRowComponent.js
Created March 26, 2018 14:29
components/TransactionRowComponent
import React, { Component } from 'react';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
export default class TransactionRowComponent extends Component {
state = {
value:null,
}
handleChange = (event, index, value) => {
this.setState({value});
import React, { Component } from 'react';
import moment from 'moment-timezone';
import TransactionRowComponent from './TransactionRowComponent';
import UploadAssetsComponent from '../Common/UploadAssetsComponent';
import {
Table,
TableBody,
TableHeader,
TableHeaderColumn,
TableRow,
@gustavonecore
gustavonecore / TransactionContainer.js
Created March 26, 2018 14:28
containers/TransactionContainer.js
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import TransactionActions from '../../Redux/TransactionRedux';
import TransactionComponent from '../../Components/Transaction/TransactionComponent';
import { browserHistory } from 'react-router';
import { Row, Grid, Col } from 'react-bootstrap';
import { DatePicker, RaisedButton } from 'material-ui';
import FontIcon from 'material-ui/FontIcon';
import IconButton from 'material-ui/IconButton';
@gustavonecore
gustavonecore / App.js
Last active March 26, 2018 14:27
Container/App.js
import '../Config';
import DebugConfig from '../Config/DebugConfig';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import LoginContainer from './LoginContainer';
import HomeContainer from './HomeContainer';
import TransactionLayout from './Layout/TransactionLayout';
import CreateTransactionLayout from './Layout/CreateTransactionLayout';
import createStore from '../Redux';
import { Router, Route, browserHistory } from 'react-router';