Skip to content

Instantly share code, notes, and snippets.

View brunocarvalhodearaujo's full-sized avatar

Bruno Carvalho de Araujo brunocarvalhodearaujo

  • Rede D'Or São Luiz
  • Rio de Janeiro, Brazil
  • 12:11 (UTC -03:00)
  • X @Bruno_C_Araujo
View GitHub Profile
@brunocarvalhodearaujo
brunocarvalhodearaujo / README.md
Created November 9, 2020 19:00 — forked from GendelfLugansk/README.md
Wrapper for expo-sqlite with async/await, migrations and transactions

Expo-sqlite - the right way

Why

With expo-sqlite it's not possible to execute few depending statements inside single transaction - db.transaction does not work with async/promise and tx.executeSql just enqueues sql statement but does not execute it.

Documentation

Database class has two methods - execute (to execute single statement without transaction) and transaction(cb) to execute few statements inside a transaction

@brunocarvalhodearaujo
brunocarvalhodearaujo / App.js
Created September 20, 2020 17:30 — forked from darryl-davidson/App.js
Example Expo 35 App that registers Background Fetch and Location Updates
import React, { useEffect } from "react";
import { StyleSheet, Text, View } from "react-native";
import * as BackgroundFetch from "expo-background-fetch";
import * as TaskManager from "expo-task-manager";
import * as Permissions from "expo-permissions";
import * as Location from "expo-location";
import { Notifications } from "expo";
import { Button } from "react-native";
const LOCATION_FETCH_TASK = "upload-job-task-with-location";
@brunocarvalhodearaujo
brunocarvalhodearaujo / login_test.scala
Created November 13, 2019 14:23 — forked from alanphil/login_test.scala
Gatling login example and showing how to pull out the HTTP authorization header into a variable
package test
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class LoginTest extends Simulation {
@brunocarvalhodearaujo
brunocarvalhodearaujo / docker-compose.yml
Created July 29, 2019 15:08 — forked from shavo007/docker-compose.yml
Docker compose (mysql, elasticsearch, kibana) with healthchecks
version: '2.1'
services:
mysql:
container_name: mysql
image: mysql:5.7
ports:
- "13306:3306"
environment:
- MYSQL_ROOT_PASSWORD=Welcome123
healthcheck:
https://www.getpostman.com/
First part from https://blog.bluematador.com/posts/postman-how-to-install-on-ubuntu-1604/
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
But when launching postman from command prompt got an error:
@brunocarvalhodearaujo
brunocarvalhodearaujo / add-desktop-icon.sh
Last active September 24, 2021 14:44 — forked from susanhoffs/add-desktop-icon.sh
Install Postman on CentOS 7
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
EOL
@brunocarvalhodearaujo
brunocarvalhodearaujo / pi.sh
Created October 13, 2018 22:18 — forked from jamesmoriarty/pi.sh
Raspberry Pi - hfs+, external disk, samba, minidlna, transmission
sudo raspi-config
sudo reboot
# mount external disk
sudo apt-get install hfsplus hfsutils hfsprogs
sudo mkdir /media/usb0
sudo nano /etc/fstab
# /dev/sda2 /media/usb0 hfsplus defaults,force,gid=pi,uid=pi,noatime 0 0
sudo chown -R root:users /media/usb0/
sudo chmod -R ug=rwx,o=rx /media/usb0/
@brunocarvalhodearaujo
brunocarvalhodearaujo / .gitlab-ci.yml
Created April 1, 2018 15:31 — forked from htuscher/.gitlab-ci.yml
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@brunocarvalhodearaujo
brunocarvalhodearaujo / docker-compose-coreos.sh
Created April 1, 2018 15:16 — forked from sourcec0de/docker-compose-coreos.sh
Install docker compose on coreos
sudo su -
mkdir -p /opt/bin
curl -L https://github.com/docker/compose/releases/download/1.20.1/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
@brunocarvalhodearaujo
brunocarvalhodearaujo / dnsd.rb
Created March 13, 2018 17:31 — forked from mrluanma/dnsd.rb
Simple, scrappy TCP DNS server in Ruby (with protocol annotations)
# Simple, scrappy TCP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL