Skip to content

Instantly share code, notes, and snippets.

View lucasfernandes's full-sized avatar
:octocat:
Always Coding!

0xtheL lucasfernandes

:octocat:
Always Coding!
View GitHub Profile
@lucasfernandes
lucasfernandes / ReactNative Snippets for Visual Studio Code
Last active December 1, 2017 12:33
Visual Studio Code - This package offers some snippets for working with React Native course boilerplate - GoNative
// javascriptreact.json
// <==== REMEMBER TO ADD THE CONTENT ABOVE IN THE SPECIFIC FILE ON VSCODE ====>
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
/* core */
import { FluidNavigator } from 'react-navigation-fluid-transitions';
/* Screens */
import SomePage from 'pages/somepage';
import AnotherPage from 'pages/somepage';
const Routes = FluidNavigator({
somepage: { screen: SomePage },
anotherpage: { screen: AnotherPage },
import {
createReactNavigationReduxMiddleware,
createNavigationReducer,
} from 'react-navigation-redux-helpers';
export default (AppNavigator) => {
const navReducer = createNavigationReducer(AppNavigator);
const middleware = createReactNavigationReduxMiddleware(
'root',
state => state.nav,
/* Redux */
import { connect } from 'react-redux';
import { reduxifyNavigator } from 'react-navigation-redux-helpers';
import reducer from './reducer';
/* Routes */
import AppNavigator from './routes';
const { navReducer, middleware } = reducer(AppNavigator);
const rootReducer = combineReducers({
nav: navReducer,
});
...
const store = configureStore(rootReducer, rootSaga, middleware);
...
/* Reducers */
import { navReducer, middleware } from 'navigation';
const rootReducer = combineReducers({
nav: navReducer,
});
// Calling a separated store manager
const store = configureStore(rootReducer, rootSaga, middleware);
/* Presentational */
import { Navigator } from 'navigation';
const App = () => (
<Provider store={store}>
<PersistGate persistor={persistor}>
<Navigator />
</PersistGate>
</Provider>
);
protocol ItemStoring {
associatedtype DataType
var items: [DataType] { get set }
mutating func add(item: DataType)
}
extension ItemStoring {
mutating func add(item: DataType) {
items.append(item)
@lucasfernandes
lucasfernandes / githubcurl.rb
Created May 21, 2020 17:36
Github curl actions
curl https://api.github.com/authorizations --user lucasfernandes --header "X-GitHub-OTP: 921217"