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
| /*Data / Information | |
| - Make | |
| - Change | |
| - Move | |
| - ?*/ | |
| var myClothes = {shirt: "red"}; | |
| function IDoStuff(){ |
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
| config.js |
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
| var coverBands = [ | |
| { | |
| contact: "[email protected]", | |
| name: "Queen" | |
| }, | |
| { | |
| contact: "[email protected]", | |
| name: "Journey" | |
| }, | |
| { |
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
| $(document).ready(function(){ | |
| //var = selector getting the app | |
| var app = $('#ajax-app'); | |
| //var = template that is a header that says 'jquery Ajax! | |
| var header = $('<h1>jQuery Ajax!</h1>'); | |
| //var = template that is a button that says get Data | |
| var getButton = $('<button>Get Data</button>'); | |
| //var = template that is a button that says clear | |
| var clearButton = $('<button>Clear Data</button>'); | |
| //var = template for a list (ul) |
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
| angular.module('httpApp').controller('myCtrl', function($scope, myService){ | |
| $scope.test = "Working" | |
| $scope.isLoading = true; | |
| var promise = myService.getStarship(); | |
| promise.then(myService.getPilots) | |
| .then(function(starshipWithPilots){ | |
| $scope.starship = starshipWithPilots; | |
| }; |
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
| var mongoose = require('mongoose'); | |
| var birdModel = mongoose.Schema({ | |
| scientificName: {type: String, required:true, unique:true, lowercase:true}, | |
| color: {type: String, required:true, unique:true}, | |
| region: String, | |
| firstSightingEver: Date, | |
| food: [String], | |
| foodDetails: [{ | |
| name: String, |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| function doStuff(p1, p2, p3){ | |
| var abc = 123; | |
| function yes(a){ | |
| console.log('words') | |
| } | |
| return yes; | |
| } | |
| doStuff(2,4,5)(6) |
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
| //Apollo client config to set up the token based on the token in the store. Has to be done this way because apollo uses middleware. | |
| import { ApolloLink } from "apollo-link"; | |
| import { HttpLink } from "apollo-link-http"; | |
| import { InMemoryCache } from "apollo-cache-inmemory"; | |
| export default ctx => { | |
| // console.log('apollo init', ctx) | |
| const uri = process.server ? "http://localhost:5000/graphql" : "/graphql"; | |
| const httpLink = new HttpLink({ uri }); |