Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: https://www.youtube.com/watch?v=pdpzrv1H2RM | |
$ sudo yum install libXcomposite libXdamage libXrandr libgbm libxkbcommon pango alsa-lib atk at-spi2-atk cups-libs libdrm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const { MongoClient } = require('mongodb'); | |
const { S3 } = require('aws-sdk'); | |
const { PassThrough } = require('stream'); | |
// Function to download image and upload to S3 | |
async function downloadAndUploadImage(imageURL, s3, s3BucketName) { | |
try { | |
const response = await axios.get(imageURL, { responseType: 'stream' }); | |
const s3Params = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"_type":"export","__export_format":4,"__export_date":"2023-09-20T01:55:46.976Z","__export_source":"insomnia.desktop.app:v2023.5.8","resources":[{"_id":"req_4157bf9d4f644c5788b108f5b93f9c79","parentId":"wrk_4ba7024e90064faaa8c8de293311e71b","modified":1695009408996,"created":1694867799799,"url":"http://localhost:3000/customers","name":"Create customer","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"cpf\": \"45645644600\",\n\t\"nome\": \"José da Silva\",\n\t\"email\": \"jose@cliente.com\",\n\t\"dataDeNascimento\": \"2010-08-24T12:00:00.000Z\",\n\t\"genero\": \"Masculino\",\n\t\"rendaMensal\": 2899.5\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"User-Agent","value":"insomnia/2023.5.8"}],"authentication":{},"metaSortKey":-1694867799799,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This solution was based on https://gist.github.com/GlenCrawford/16163abab7852c1bd550547f29971c18 | |
Rails.configuration.to_prepare do | |
ActiveRecord::SchemaDumper.ignore_tables = %w[ | |
salesforce._hcmeta | |
salesforce._sf_event_log | |
salesforce._trigger_log | |
salesforce._trigger_log_archive | |
] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overrides Rails file activerecord/lib/active_record/schema_dumper.rb to | |
# include all schema information in the db/schema.rb file, for example, in the | |
# create_table statements. This allows for a working development database | |
# to be built from a schema.rb file generated by rake db:schema:dump. | |
# | |
# This is essentially a rebuild of the "schema_plus_multischema" gem (which is | |
# unfortunately only compatible with Rails ~> 4.2). | |
# | |
# Tested with Rails 6.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"applinks": { | |
"apps": [], | |
"details": [ | |
{ | |
"appIDs": [ | |
"JZS429223Z.com.playlegis" | |
], | |
"appId": "JZS429223Z.com.playlegis", | |
"components": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require("mongoose"); | |
const { MongoMemoryServer } = require("mongodb-memory-server"); | |
let mongoServer = null; | |
const connect = async () => { | |
mongoose.Promise = global.Promise; | |
mongoServer = new MongoMemoryServer(); | |
const mongoUri = await mongoServer.getUri(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import supertest from "supertest"; | |
import app from "../../../app"; | |
import { connect, disconnect } from "../../../../test/database"; | |
import { | |
generateUser, | |
removeUsers, | |
removePlates, | |
generatePlate | |
} from "../../../../test/helper"; |
NewerOlder