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
| { | |
| "Title": "TestPage", | |
| "Body": "VGhpcyBpcyBhIHNhbXBsZSBQYWdlLg==" | |
| } |
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 Animal(sound) { | |
| this.makeSound = function () { | |
| return sound; | |
| }; | |
| } | |
| function identify() { | |
| return "I am " + this.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
| Context: | |
| - object based..ref to object which owns current executing code | |
| - look out for implicit binding | |
| - 'new' operator causes function to be called with 'this' bound to newly created object | |
| Scope: | |
| - function based..can be in function or Global | |
| Prototype chain: | |
| - delegates up prototype chain to function Object. |
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
| +someFile.js | |
| let submitButton = require('submitButton'); | |
| let markup = submitButton.present(params); | |
| $form.html(markup); | |
| +SubmitButton.js | |
| let template = 'views/partials/submit.mustache' | |
| let mustache = require('mustache'); |
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
| ### What about the other tools? | |
| - PhantomCSS - Image comparison using ResembleJS which did colours well but very little else was caught on testing | |
| - CSS Critic - Does not work on command line | |
| - Wraith - Must run off 2 different domains everytime, is built this way.Takes a while to run (3-5 seconds per image). Built with Ruby so requires the right environment. | |
| ### Why not use PhantomJS? | |
| - Did not find any decent image comparison library for it (see PhantomCSS at bottom for more). | |
| - Its not a node module whereas Webshot is a light wrapper around PhantomJS. |
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
| -- 1. Parsing hexadecimal values to get the RGB color values. | |
| var hex = 'ffaadd'; | |
| var rgb = parseInt(hex, 16); // value is 1675421 | |
| var red = (rgb >> 16) & 0xFF; // returns 255 | |
| var green = (rgb >> 8) & 0xFF; // 170 | |
| var blue = rgb & 0xFF; // 221 | |
| ---- |
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
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: craig-uw-test-project | |
| namespace: default | |
| labels: | |
| app: craig-uw-test-project | |
| public-lb: traefik | |
| spec: | |
| rules: |
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 crypto = require('crypto'); | |
| function stringifyOnce(obj, replacer, indent = 4) { | |
| var printedObjects = []; | |
| var printedObjectKeys = []; | |
| function printOnceReplacer(key, value) { | |
| // console.log(key); | |
| var printedObjIndex = false; | |
| printedObjects.forEach(function(obj, index) { |
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
| // -------- declaration of Store, reducers, actions -------- -------- | |
| function createStore(reducers) { | |
| let currentSubscribers = []; | |
| const dispatch = (action) => { | |
| const currentState = reducers[action.type](currentState, action); | |
| for (let i = 0; i < currentSubscribers.length; i++) { | |
| currentSubscribers[i](currentState); | |
| } |
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
| // -------- declaration of Store -------- -------- | |
| const runUntilDone = (iterator) => { | |
| if (!iterator.next().done) { | |
| runUntilDone(iterator); | |
| } | |
| } | |
| function createStore(reducers, sagas) { | |
| let currentSubscribers = []; |