This file contains 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
#################################################### | |
# Global .gitignore Flle | |
# Reference: http://help.github.com/ignore-files/ | |
# Save this in a file: ~/.gitignore_global | |
# Then at the command line (you will see more info if a repo is in the current folder): | |
# git config --global core.excludesfile ~/.gitignore_global | |
# git config --list | |
##################### | |
# Maven # |
This file contains 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
PREREQUISITES | |
This assumes that you have already experimented with creating instances under EC2 and know | |
how to use ssh keys to access an instance. If not, try experimenting with that first and | |
setup some keys. | |
This also assume that you have a Security Group with Port 80 available. If not, experiment | |
with creating one of those as well. | |
CREATE A NEW INSTANCE |
This file contains 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
#!upstart | |
description "myapp nodejs server" | |
author "Mitch Allen" | |
start on startup | |
stop on shutdown | |
respawn | |
expect fork | |
expect daemon |
This file contains 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/sh | |
echo "Stopping service" | |
sudo stop myapp | |
echo "Deploying to test ..." | |
_TREE=/export/home/MY-USER/test | |
GIT_WORK_TREE=$_TREE git checkout -f | |
cd $_TREE | |
pwd | |
echo "Installing dependencies" | |
npm install |
This file contains 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 './NotFound.css'; | |
export default () => ( | |
<div className="NotFound"> | |
<h3>Sorry, page not found!</h3> | |
</div> | |
); |
This file contains 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
/* | |
* An example of using reduce to combine child arrays | |
* | |
* Expected Output: | |
SOURCE: | |
[ | |
{ | |
"name": "alpha", | |
"kids": [ |
This file contains 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
/* | |
Using reduce to count the occurrence of an item in a list. | |
[ 'd', 'a', 'b', 'a', 'b', 'c', 'd', 'b', 'd', 'd' ] | |
a occurs 2 times in the list. | |
b occurs 3 times in the list. | |
c occurs 1 time in the list. | |
d occurs 4 times in the list. | |
*/ |
This file contains 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 strict"; | |
var five = require("johnny-five"), | |
board = new five.Board(), | |
led = null, | |
express = require('express'), | |
app = express(), | |
port = 8000; | |
board.on("ready", function() { |
This file contains 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 strict"; | |
var five = require("johnny-five"), | |
board = new five.Board(), | |
servos = null, | |
servoPins = [9, 10], | |
// servoPins = [9], // if you have only one servo | |
express = require('express'), | |
app = express(), | |
port = 8000; |
This file contains 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
// File: cube.js | |
// Author: Mitch Allen | |
// 1. Define and export a cube factory class | |
export class CubeFactory { | |
// 2. Define a static create method to return new cubes | |
static create( spec = {} ) { | |
// 3. Setup default values or use arguments |
OlderNewer