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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
#new bondfar | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
client_max_body_size 500M; |
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
- we're just giving them a taste of what it's like to code. you just open jsbin, explain to them what a variable is as you show them how to write it, do the same with functions and if statements, and then create a function that's a "greeter app" with them where the computer is prompted to say "good morning," "good afternoon," or "good night" based on what time of day it is. then you call the function with different times. when you're creating the greeter app you do it more code along style so that the students are getting the concept of creating if statements and seeing how easy it can be | |
What is a variable | |
- You can place data into these containers and then refer to the data simply by naming the container. | |
- references to data stored in memory | |
//create a program that's a "greeter app" where the computer is prompted to say "good morning," "good afternoon," or "good night" based on what time of day it is. | |
//pseudocode this first |
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
//create db | |
CREATE DATABASE db_name; | |
//create table | |
CREATE TABLE table_name | |
( | |
col1_name datatype, | |
col2_name datatype, | |
col3_name datatype, | |
... |
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
#show schemas | |
\dt | |
#show all rows and collumns | |
SELECT * FROM [table]; | |
#remove duplicates | |
SELECT DISTINCT [collumn] FROM [TABLE] | |
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
#overwrite current branch to master | |
git checkout seotweaks | |
git merge -s ours master | |
git checkout master | |
git merge seotweaks | |
#force pull from master and overwrite | |
git fetch origin | |
git reset --hard origin/master |
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
#If you specified your keys in a credentials file, this command looks like this to create an instance called aws-sandbox: | |
$ docker-machine create --driver amazonec2 aws-sandbox | |
#no crednetials file | |
$ docker-machine create --driver amazonec2 --amazonec2-access-key AKI******* --amazonec2-secret-key 8T93C******* aws-sandbox | |
# specify a region...default is automaticaally set to us-east-1 | |
$ docker-machine create --driver amazonec2 --amazonec2-region us-west-1 aws-01 | |
#make sure new machine is active host |
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
#Go to the directory that has your Dockerfile and run the following command to build the Docker image | |
$ docker build -t <your username>/node-web-app . | |
#to run image and redirect port | |
$ docker run -p 49160:8080 -d <your username>/node-web-app | |
# see running containers | |
$ docker ps | |
# Print app output |
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 strict'; | |
const express = require('express'); | |
// Constants | |
const PORT = 8080; | |
// App | |
const app = express(); | |
app.get('/', function (req, res) { |
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 | |
RUN mkdir -p /usr/src/your-app-name | |
WORKDIR /usr/src/your-app-name | |
COPY package.json /usr/src/your-app-name/ | |
RUN npm install | |
COPY . /usr/src/your-app-name | |
EXPOSE 3000 | |
CMD [ "npm", "start" ] |
NewerOlder