Skip to content

Instantly share code, notes, and snippets.

View shams-ali's full-sized avatar

Shams Ali shams-ali

  • San Francisco, CA
View GitHub Profile
<!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">
@shams-ali
shams-ali / nginx.conf
Created February 22, 2017 01:21
nginx config
#new bondfar
worker_processes 1;
events {
worker_connections 1024;
}
http {
client_max_body_size 500M;
@shams-ali
shams-ali / infoSession.txt
Last active January 16, 2017 19:28
Info Session Run Down
- 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
@shams-ali
shams-ali / sqlCommands.txt
Last active July 30, 2016 20:13
SQL Commands
//create db
CREATE DATABASE db_name;
//create table
CREATE TABLE table_name
(
col1_name datatype,
col2_name datatype,
col3_name datatype,
...
@shams-ali
shams-ali / postgres.sh
Created June 30, 2016 18:58
Postgres Commands
#show schemas
\dt
#show all rows and collumns
SELECT * FROM [table];
#remove duplicates
SELECT DISTINCT [collumn] FROM [TABLE]
@shams-ali
shams-ali / github.sh
Last active July 1, 2016 22:22
Github Commands
#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
@shams-ali
shams-ali / aws-docker-machine-create.sh
Last active June 25, 2016 04:55
AWS Docker Create
#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
@shams-ali
shams-ali / docker-commads.sh
Last active December 27, 2016 06:46
Docker Commands
#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
@shams-ali
shams-ali / expressserver.js
Created June 25, 2016 04:31
express server
'use strict';
const express = require('express');
// Constants
const PORT = 8080;
// App
const app = express();
app.get('/', function (req, res) {
@shams-ali
shams-ali / Dockerfile
Created June 25, 2016 04:26
Node Dockerfile
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" ]