Skip to content

Instantly share code, notes, and snippets.

View 1fabiopereira's full-sized avatar
👨‍💻
Working from home

Fábio Pereira 1fabiopereira

👨‍💻
Working from home
  • Guaratinguetá - SP, Brazil
View GitHub Profile
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
rootProject.name = 'AppName'
include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android')
include ':@react-native-firebase_analytics'
project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/analytics/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
/*
target: the object to search for in the array
comparator: (optional) a method for comparing the target object type
return value: index of a matching item in the array if one exists, otherwise the bitwise complement of the index where the item belongs
*/
Array.prototype.binarySearch = function (target, comparator) {
var l = 0,
h = this.length - 1,
m, comparison;
comparator = comparator || function (a, b) {
const rejson = require('./redis-json-wrapper')
const redis = rejson(require('redis'))
class RedisClient {
constructor ({ host, port, prefix }) {
/**
* Redis client
*/
this.client = redis.createClient({ host, port, prefix })
module.exports = (redis) => {
const cmds = [
// O(N), where N is the size of the deleted value.
'json.del',
// O(N), where N is the size of the value.
'json.get',
// O(M*N), where M is the number of keys and N is the size of the value.
'json.mget',
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mobimidia.climaTempo"
android:versionCode="137"
android:versionName="5.0.36">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
{ ValidationError: child "uv" fails because ["uv" is required],
isJoi: true,
name: 'ValidationError',
details:
[ { message: '"uv" is required',
path: [Array],
type: 'any.required',
context: [Object] } ],
_object:
{ max: '30',
(function () {
let promiseChain = Promise.resolve();
const promises = {};
const callbacks = {};
const init = () => {
// Gera o uuid da msg
const guid = () => {
// Faz consulta no BD 1
class Database1 {
static getAll () {
return [
{
id: 1,
name: "Name-1"
},
{
id: 2,