Skip to content

Instantly share code, notes, and snippets.

View lucasferreira's full-sized avatar
🤓
burnweb.com.br

Lucas Ferreira lucasferreira

🤓
burnweb.com.br
View GitHub Profile
{
"window.closeWhenEmpty": false,
"files.insertFinalNewline": true,
"editor.rulers": [80, 120],
"files.trimTrailingWhitespace": true,
"files.associations": {
"*.blade.php": "php",
"*.ctp": "php"
},
"editor.acceptSuggestionOnEnter": "on",
import { StatusBar } from "expo-status-bar";
import { StyleSheet, SafeAreaView, ScrollView, View, Text } from "react-native";
import { Provider as PaperProvider, Button } from "react-native-paper";
import KittenCard from "./components/KittenCard";
export default function App() {
return (
<PaperProvider>
<StatusBar style="auto" translucent={false} />

Tendo o Node.js instalado em sua máquina:

npm install -g expo-cli

npx create-expo-app meu-app


depois acessar a pasta do novo projeto criado, ex:

@lucasferreira
lucasferreira / git.md
Created August 10, 2021 14:26 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@lucasferreira
lucasferreira / rn-flatlistGrid.js
Created June 21, 2019 12:11
React Native FlatList Grid
// code by @spencercarli
import React from 'react';
import { StyleSheet, Text, View, FlatList, Dimensions } from 'react-native';
const data = [
{ key: 'A' }, { key: 'B' }, { key: 'C' }, { key: 'D' }, { key: 'E' }, { key: 'F' }, { key: 'G' }, { key: 'H' }, { key: 'I' }, { key: 'J' },
];
const formatData = (data, numColumns) => {
const numberOfFullRows = Math.floor(data.length / numColumns);
@lucasferreira
lucasferreira / absoluteTimers.js
Created November 7, 2018 13:16
Absolute setInterval and setTimeout to work in "stand by" tabs
function absoluteSetInterval(fn, millis) {
try {
var baseTime = Date.now();
var callHandler = function() {
if (Date.now() - baseTime > millis) {
baseTime = Date.now();
fn();
}
};
return {
@lucasferreira
lucasferreira / react-async-fetcher-demo.jsx
Created August 22, 2018 18:00
React Async Fetcher Demo #1
import React from "react";
import AsyncFetcher from "react-async-fetcher";
const MyIpWidget = () => (
<AsyncFetcher url="https://ipapi.co/json/">
{({ isLoading, error, data }) => {
// some loading state...
if (isLoading) {
return <p>Loading data...</p>;
}
<?php
try {
$wsUrl = "HTTP://URL_COMPLETA_DO_WEBSERVICE?WSDL"; // normalmente as URLs de WS contém esse `?WSDL` no final...
$clientSoap = new SoapClient($wsUrl, array(
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
"trace" => true,
"encoding" => "utf-8",
"exceptions" => true,
"connection_timeout" => 120,
@lucasferreira
lucasferreira / aws_snapshot.sh
Created November 19, 2017 19:47
Simple bash script to run a snapshot backup at AWS EC2 Instance
#!/bin/bash
# Volume list file will have volume-id:Volume-name format
VOLUMES_LIST=/var/log/volumes-list
SNAPSHOT_INFO=/var/log/snapshot_info
DATE=`date +%Y-%m-%d`
REGION="sa-east-1" # change for your region
# Snapshots Retention Period for each volume snapshot
RETENTION=6
<?php
function randomPassword($len=8)
{
$chars = 'abcdefghijlmnopqrstuvxyzkw123456789';
$numChars = strlen($chars);
$pwd = '';
for ($i=0; $i<$len; $i++)
{
$pwd .= substr($chars, rand(1, $numChars) - 1, 1);