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 Book = function(title) { | |
this.title = title; | |
} | |
// Let's add a method to Book | |
Book.prototype.getTitle = function() { | |
return this.title; | |
} | |
// Create an instance of Book |
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
// Define a new Constructor function | |
var Coffee = function(type) { | |
this.type = type; | |
} | |
// Add a property to our object | |
Coffee.prototype.taste = 'sweet'; | |
// Create an instance of Coffee | |
// This instance inherits all the properties of Coffee |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function World (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
REM Windows | |
start chrome --disable-web-security --user-data-dir="C:/temp/chrome_dev" |
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
// OSX | |
open -na Google\ Chrome --args --disable-web-security --user-data-dir="/tmp/chrome_dev" |
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 Header from './Header'; | |
import Sidebar from './Sidebar'; | |
import Footer from './Footer'; | |
import { Oops } from './Oops'; // Importing a non-default export | |
export default function HomePage({ data, error }) { | |
let component = ( | |
<div> | |
<Header links={data.headerLinks} /> |
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 HomePage from '../components/HomePage'; | |
import Header from '../components/Header'; | |
import Sidebar from '../components/Sidebar'; | |
import Footer from '../components/Footer'; | |
import { Oops } from '../components/Oops'; | |
describe('The HomePage component', function () { | |
describe('when there is no error', 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
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import proxyquire from 'proxyquire'; | |
proxyquire.noCallThru(); | |
const Header = () => <div></div>; // stub component | |
const Sidebar = () => <div></div>; // stub component | |
const Footer = () => <div></div>; // stub component | |
const Oops = () => <div></div>; // stub component |
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
// math.js | |
export function sum(a, b) { | |
return a + b; | |
} | |
export default function sub(a, b) { | |
return a - b; | |
} | |
// main.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
FROM node:6 | |
ADD . /app | |
WORKDIR /app | |
RUN npm i |
OlderNewer