-
Open your project (if you're using WebPack, obviously)
-
npm install sinon --save-dev
-
You should now have Sinon in your node modules and listed in your
package.json
file -
In your tests, require Sinon:
var sinon = require('sinon');
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
# ----- Classes ----- | |
class Node | |
attr_accessor :data, :next_node | |
def initialize(data, next_node) | |
@data = data | |
@next_node = next_node | |
end | |
end | |
class List |
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
_ \ | |
, __ , # (C) Josh Cheek | |
*,_ = # 2015 | |
def __ ___ , # Inspiration | |
*__, **_ # Is | |
putc ___ # Obviously | |
end, def _ *_, # Yusuke | |
**__ # Endoh | |
_. # | |
map {|_ ;__ # And |
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
// Annotated Code -- CRUD with Rails-React | |
// Functions we get from the React framework will be marked with -> R! | |
// to get the full repo: `$ git clone [email protected]:applegrain/ideabox-react.git` | |
// https://facebook.github.io/react/docs/thinking-in-react.html | |
// Good read to get into the React state of mind | |
// Create a new dashboard component. | |
var Dashboard = React.createClass({ |
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 name="charset" content="UTF-8"> | |
<title>Buttons Upon Buttons</title> | |
<style> | |
button { | |
padding: 1em; | |
border: none; | |
} |
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
///// index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import HelloWorld from './HelloWorld'; | |
ReactDOM.render(<HelloWorld name='Meeka' />, document.getElementById('container')); | |
///// HelloWorld.js |
Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.
- TCP port 2377 for cluster management & raft sync communications
- TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
- UDP port 4789 for "data plane" VXLAN overlay network traffic
- IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex
command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
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
AWSTemplateFormatVersion: '2010-09-09' | |
Metadata: {} | |
Parameters: | |
########### | |
KeyName: | |
Description: The EC2 Key Pair to allow SSH access to the instance | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
AvailabilityZone: | |
Description: Availability zone to deploy |
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
#!/bin/bash | |
mkdir postgres | |
cd postgres | |
docker volume create --driver local --name=pgvolume | |
docker volume create --driver local --name=pga4volume | |
docker network create --driver bridge pgnetwork |