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
  • 15:47 (UTC -03:00)
  • X @Bruno_C_Araujo
View GitHub Profile
@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 / 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 / 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

I had a bit of trouble figuring out how to use bitnami's sealed secrets with helm

Here's a definition of done to help you see what I was trying to achieve.

Definition of done

  • Single secret available for a release in a namespace, listing all secret variables
  • Regular helm workflow, with no extra kubeseal commands for developers
  • Encrypted secrets clearly visible in git
  • Sealedsecret managed by helm
@brunocarvalhodearaujo
brunocarvalhodearaujo / Jenkinsfile
Created July 21, 2021 16:39 — forked from mrhockeymonkey/Jenkinsfile
Jenkins pipeline running a remote ansible playbook
#!groovy
pipeline {
agent any
//These params will be displayed for user input when running a build, They are also accepted by the API
parameters {
string(name: 'BUILD_HOSTNAME', description: 'The name of the server to build (from Mdb)')
string(name: 'ILO_IP', description: 'The IP address for the server ilo')
booleanParam(name: 'skipOneView', description: 'Skip the OneView stage?', defaultValue: false)
@brunocarvalhodearaujo
brunocarvalhodearaujo / gist:b1ffcd33f4128015fda67bd89b010d0e
Created September 2, 2021 03:58 — forked from katowulf/gist:4741111
Firebase security rules for a simple chat room model
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users
@brunocarvalhodearaujo
brunocarvalhodearaujo / database.rules.json
Created September 2, 2021 05:10 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@brunocarvalhodearaujo
brunocarvalhodearaujo / postgres_queries_and_commands.sql
Created September 13, 2021 00:38 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@brunocarvalhodearaujo
brunocarvalhodearaujo / dd-tracing-logging-examples-nodejs.js
Created February 3, 2022 22:01 — forked from stevenc81/dd-tracing-logging-examples-nodejs.js
A quick example for Datadog APM tracing and logging
require('dd-trace').init({
hostname: process.env.DD_AGENT_HOST,
port: 8126,
env: 'development',
logInjection: true,
analytics: true,
});
const { createLogger, format, transports } = require('winston');
const addAppNameFormat = format(info => {
const categories = useMemo(() => {
return products.reduce((categories, { category }) => {
return !category || categories.find(({ id }) => category && category.id === id)
? categories
: [
...categories,
{
id: category.id,
value: category.id,
label: category.title,