Skip to content

Instantly share code, notes, and snippets.

Avatar
❤️
Because I was born in this world

Alberto Ammar albertoammar

❤️
Because I was born in this world
  • Banco dos Imóveis
  • São Paulo, Brasil
View GitHub Profile
@albertoammar
albertoammar / README-Template.md
Created Jul 27, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@albertoammar
albertoammar / aws-linux-docker.sh
Created Jul 8, 2020
Install docker, docker-compose and awscli latest in aws linux
View aws-linux-docker.sh
sudo yum update -y
sudo amazon-linux-extras install docker
sudo yum install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo yum install python37
@albertoammar
albertoammar / CollapsingNav.js
Created Apr 28, 2020 — forked from andigu/CollapsingNav.js
A Collapsing Navbar with Tabs in React Native
View CollapsingNav.js
import React, {Component} from "react";
import {Animated, Dimensions, Platform, Text, View} from 'react-native';
import {Body, Header, List, ListItem as Item, ScrollableTab, Tab, Tabs, Title} from "native-base";
const NAVBAR_HEIGHT = 56;
const {width: SCREEN_WIDTH} = Dimensions.get("window");
const COLOR = "rgb(45,181,102)";
const TAB_PROPS = {
tabStyle: {width: SCREEN_WIDTH / 2, backgroundColor: COLOR},
activeTabStyle: {width: SCREEN_WIDTH / 2, backgroundColor: COLOR},
View API.md

Route Login

Used to collect a Token for a registered User. rent_townhouse_price

URL : /api/login/{id}

Method : POST

Auth required : NO

@albertoammar
albertoammar / metro.config.js
Last active Feb 19, 2020 — forked from 6pm/metro.config.js
Configure metro.config.js to use symbolic link in react native
View metro.config.js
const path = require('path');
// react-native >= 0.57
const extraNodeModules = {
'qb-core': path.resolve(__dirname + '/../qb-core/'),
};
const watchFolders = [
path.resolve(__dirname + '/../qb-core/')
];
@albertoammar
albertoammar / mysql-docker.sh
Created Feb 9, 2020
Mysql/Mariadb docker backup and restore.
View mysql-docker.sh
# Backup
docker run mariadb /usr/bin/mysqldump -h localhost -u root --password=root DATABASE > backup.sql
@albertoammar
albertoammar / Update remote repo
Created Jan 9, 2020 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
View Update remote repo
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@albertoammar
albertoammar / post-receive
Created Oct 11, 2018 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
View post-receive
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then