This file contains hidden or 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
/* | |
LinkedList | |
Name your class / constructor (something you can call new on) LinkedList | |
LinkedList is made by making nodes that have two properties, the value that's being stored and a pointer to | |
the next node in the list. The LinkedList then keep track of the head and usually the tail (I would suggest | |
keeping track of the tail because it makes pop really easy.) As you may have notice, the unit tests are the | |
same as the ArrayList; the interface of the two are exactly the same and should make no difference to the | |
consumer of the data structure. |
This file contains hidden or 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 React from 'react'; | |
import { Field, reduxForm } from 'redux-form'; | |
import { connect } from 'react-redux'; | |
import TextField from 'material-ui/TextField'; | |
import FlatButton from 'material-ui/FlatButton'; | |
import * as actions from '../../actions/itnItems.actions'; | |
import './quotedPriceForm.css'; |
This file contains hidden or 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 React from 'react'; | |
import { shallow } from 'enzyme'; | |
import preload from '../../data.json'; | |
import ShowCard from '../ShowCard'; | |
test('search should render correct amount of shows', () => { | |
const component = shallow(<Search />); | |
expect(component.find(ShowCard.length)).toEqual(preload.shows.length)); | |
}); |
This file contains hidden or 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
https://medium.com/@ekeyur/bluebirds-map-and-mapseries-explained-by-cooking-pasta-7dd03a19ea61 |
This file contains hidden or 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
// through iteration - my initial attempt | |
class Tree { | |
constructor() { | |
this.root = null; | |
} | |
add(value) { | |
const newNode = new Node(value); | |
if (!this.root) this.root = newNode; | |
else{ |
This file contains hidden or 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
// Apex controller | |
public with sharing class ListRacesController { | |
@AuraEnabled | |
public static List<Race__c> getRacesDB() { | |
return [SELECT Id, Name, DateTime__c FROM Race__c]; | |
} | |
} | |
// helper function | |
({ |
This file contains hidden or 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
// Aggregate query for non-null Social Id Field | |
// In this case we query all contactsfor social custom fields and group them by accountId | |
List<AggregateResult> totals = | |
[SELECT AccountId, | |
count(twitterId__c) twits, | |
count(FacebookID__c) likes, | |
count(linkedInID__c) Links, | |
FROM Contact | |
WHERE AccountID IN :mapToAccounts.keyset() |
This file contains hidden or 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
// we have seen the ListPage component, but it isn't containing anything yet. It would be nice to have a preview component for every Pokemon in our Pokedex that switches to a detailed view whenever we click on it. | |
export default Relay.createContainer( | |
PokemonPreview, | |
{ | |
fragments: { | |
pokemon: () => Relay.QL` | |
fragment on Pokemon { | |
id | |
name |
This file contains hidden or 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
Problems with Rest API | |
- no idea the data structure from the api | |
- too many network apis /proprietory api - baking api into applications for react native and needs to deploy each version api endpoint for each version app api/v1/user, api/v2/user...etc | |
// --------------------------------------------- | |
// GraphQL Server | |
- query language for both client and server | |
- client specified queries not api request | |
1. Exposes a single endpoint |
This file contains hidden or 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
// mkdir server | |
// dependencies | |
// npm install --save express mongoose morgan body-parser nodemon bcrypt-nodejs jwt-simple passport passport-jwt cors | |
- express | |
- mongoose | |
- morgan | |
- body-parse | |
- nodemon | |
- bcrypt | |
- jwt-simple |