Skip to content

Instantly share code, notes, and snippets.

View vitorleonel's full-sized avatar
🎯
Focusing

Vitor Leonel vitorleonel

🎯
Focusing
View GitHub Profile
@vitorleonel
vitorleonel / Helpers.php
Last active September 11, 2020 12:59
[Laravel] function to check if it is the current route and return a specific class for make item is active or no
<?php
if (! function_exists('currentRoute'))
{
/**
* Return class when is current route match passed name.
*
* @param string $name
* @param string $htmlClass
* @return string
import React from "react";
import Navigation from "./navigation"; // instancia do createAppContainer
import StatusBarConfig from "./config/StatusBarConfig";
function App() {
return <Navigation onNavigationStateChange={StatusBarConfig} />
}
export default App;
import { StatusBar, Platform } from "react-native";
const getActiveRouteName = navigationState => {
if (!navigationState) return null;
const route = navigationState.routes[navigationState.index];
if (route.routes) {
return getActiveRouteName(route);
}
@vitorleonel
vitorleonel / react-native-offline-bundling-android
Created June 20, 2019 22:53 — forked from erikyuntantyo/react-native-offline-bundling-android
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
@vitorleonel
vitorleonel / nodejs-api-pagamento package.json
Last active January 20, 2019 12:52
nodejs-api-pagamento-package-json-scripts
"scripts": {
"start": "nodemon src"
}