Skip to content

Instantly share code, notes, and snippets.

Shortcut Cheatsheet

Terminal

  • Ctrl-A - go to the beginning of the line
  • Ctrl-E - go to the end of the line
  • Up Arrow - bring up the previous command in the command history
  • TAB - autocomplete commands or files or directories

OSX

/*
JS Workshop
*/
// Variable assignment
var name = "Jenn";
var age = 5;
var sentence = name + " is " + age + " years old.";

Exercises 2

1 to 10

Using a while loop. Print the numbers from 1 to 100, one on a line.

1 to 100

Using a while loop. Print the numbers from 1 to 100, one on a line.

Exercises

Make a Sentence

Given the following variable declarations:

var person = 'Lee';
var car = 'Honda Civic';
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>Hello World</h1>'
})
export class AppComponent {
}
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>Hello World</h1>'
})
export class AppComponent {
}
@airportyh
airportyh / play.js
Last active August 13, 2016 02:31
Plays the Final Fantasy II Theme. Requires https://github.com/gleitz/midi-js-soundfonts to be installed into the same directory.
var playSound = require('play-sound');
var path = require('path');
var _ = require('lodash');
var player = playSound();
var chords = [
['c3', 'd3', 'e3', 'g3'],
['a2', 'b2', 'c3', 'e3'],
['c3', 'd3', 'e3', 'g3'],
['a2', 'b2', 'c3', 'e3'],
<!DOCTYPE html>
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- polyfill -->
<script src="../inc/shim/Base64.js" type="text/javascript"></script>
<script src="../inc/shim/Base64binary.js" type="text/javascript"></script>
<script src="../inc/shim/WebAudioAPI.js" type="text/javascript"></script>
<!-- midi.js package -->
<script src="../js/midi/audioDetect.js" type="text/javascript"></script>