class declaration (with a primary constructor):
class MongoClient(val host: String, val port: Int)| package easy.datastructures.linkedlist; | |
| public interface DoublyLinkedListBehaviors<T> extends LinkedListBehaviors<T> { | |
| } |
| package easy.datastructures.array; | |
| import java.util.Arrays; | |
| import java.util.Iterator; | |
| @SuppressWarnings("unchecked") | |
| public class Array<T> implements Iterable<T>, ArrayBehaviors<T> { | |
| protected T[] array; // Internal structure. FIXED length | |
| protected int len; // the number of elements added to the array |
| package playground | |
| import scala.annotation.tailrec | |
| import scala.io.StdIn | |
| import scala.util.Random | |
| trait Action { | |
| def actionType(): String | |
| } |
| package playground.java.covariance; | |
| import java.util.ArrayList; | |
| public class CovarianceOnMethodInvocation { | |
| public static void main(String[] args) { | |
| new CovarianceOnMethodInvocation().run(); | |
| } | |
| public void run() { |
| const db = require('./connect')(); | |
| const crudServices = require('./knexCrud')(db); | |
| const serviceFactory = require('./serviceFactory')(crudServices); | |
| const App = function(serviceFactory) { | |
| const accountsService = serviceFactory('accounts'); | |
| const usersService = serviceFactory('users'); | |
| return { | |
| getAllAccounts: () => accountsService.getAll(), |
| alter table entries add column transaction_id integer references transactions(id) not null; | |
| select * from accounts | |
| insert into transactions(value, description, destiny_account_id, origin_account_id) | |
| values(5800.00, '05/2018 Salary', 19, 17); | |
| insert into entries(value, account_id, transaction_id) | |
| values(-5800.00, 17, 7); |
| const logado = false; | |
| const PrivateRoute = ({ render, ...rest }) => ( | |
| <Route | |
| {...rest} | |
| render={props => | |
| logado ? ( | |
| render(props) | |
| ) : ( | |
| <Redirect |
| import { createStore, combineReducers, applyMiddleware } from 'redux'; | |
| import { Provider, connect } from 'react-redux'; | |
| import thunk from 'redux-thunk'; | |
| import { v4 } from 'uuid'; | |
| // Users ------------------------------------------------------------------------------- | |
| const ADD_USER = 'ADD_USER'; | |
| const addUserAction = (user) => ({ |
| import React, { Component } from 'react'; | |
| import './App.css'; | |
| import LoginForm from './loginForm'; | |
| import RegistrationForm from './registrationForm'; | |
| import ConsumptionForm from './consumptionForm'; | |
| const PrivateContent = ({ user, children }) => ( | |
| <div> | |
| <img alt="user avatar" src={ user.photoURL }/> { user.name } | { user.email } | |