Skip to content

Instantly share code, notes, and snippets.

View slugbyte's full-sized avatar
⌨️

Duncan Marsh slugbyte

⌨️
View GitHub Profile

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Layout Demo</title>
    <link rel="stylesheet" type="text/css" href="css/normalize.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
  </head>
  <body>

code for bus mall

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>Bus Mall</title>
    <link rel="stylesheet" type="text/css" href="css/style.css"></link>
<!DOCTYPE html>
<html>
<head>
<title>Learn JQUERY Demo</title>
<script src="http://code.jquery.com/jquery-2.2.1.min.js" type="text/javascript" > </script>
</head>
<body>
<header>
<h1 class="logo">Welcome to my demo</h1>
<nav>

git team workflow

when you start a new feature...

  • start from an uptodate master branch
  • git checkout master
  • git pull origin master
  • do work and add, commit, and push
  • git add <file>
  • git commit -m

Out with the old

First type which node && which npm if you get anything other than a blank line you already have node installed and need to remove it. If you used the node installer from their website use these commands:

sudo rm -rf $(which node)
sudo rm -rf $(which npm)
sudo rm -rf ~/.node
sudo rm -rf ~/.npm

Now if you type which node && which npm you should have a blank line.

grading check list

BEFORE YOU START

  • create folder for grading all student work in your section
  • create directories for each of the students in your section

Checklist

  1. did they answer all the questions in there comments on canvas
  • if no

handling async data

index.js

'use strict';

const getData = require(__dirname + '/lib/async-get-data');


getData(function(err, data){

index.js

'use strict';

const Cat = require('./lib/cat');
const cat = new Cat();
const filePaths = [
  __dirname + '/data/1.txt',
  __dirname + '/data/2.txt',
 __dirname + '/data/3.txt'
@slugbyte
slugbyte / assert.js
Created May 5, 2016 07:08
test output of the node assert modules methods against various data types
var assert = require('assert');
var logAssert = function(method, expected, result){
if (typeof(expected) != 'object'){
var paramString = '' + expected + ' ' + result;
process.stdout.write(' ' + paramString);
} else {
process.stdout.write(' ');
process.stdout.write(JSON.stringify(expected) + ' ' + JSON.stringify(result));
}
'use strict';
const Transform = require('stream').Transform;
const upperTransform = new Transform({
transform: function(chunk, encoding, next){
this.push(chunk.toString().toUpperCase());
next();
}
});