Skip to content

Instantly share code, notes, and snippets.

View joechan3's full-sized avatar

Joseph Chan joechan3

  • Edmonton, AB, Canada
View GitHub Profile
@joechan3
joechan3 / project_spec.js
Created July 8, 2016 20:44
Jasmine Spec Boilerplate
describe("Calculator", function () {
beforeEach(function () {
Calculator.current = 0;
});
describe("When adding numbers", function () {
it("should store the current value at all times", function () {
expect(Calculator.current).toBeDefined();
});
@joechan3
joechan3 / base.css
Last active June 16, 2016 19:46
Applying RWD Styles
@-ms-viewport {
width: device-width;
}
@import "reset";
@import "smallest";
@media print {
@import "print";
}
@joechan3
joechan3 / ratio.html
Created June 16, 2016 03:28
Container which maintains the ratio
<!doctype html>
<html>
<head>
<style>
/* container which maintains the ratio */
/* padding-bottom is the magic rule to set the aspect ration */
.container {
position: relative;
height: 0;
Grab mustache.js from https://github.com/janl/mustache.js/
Link to: <script type="text/javascript" src="../mustache.js"></script>
(Simple Template)
<script type="text/template" id="templateID">
<div class="contentWrapper">
<div>{{field1}}</div>
<div>{{field1}}</div>
<div>{{field1}}</div>
</div>
@joechan3
joechan3 / JSHint Config
Created May 23, 2016 21:01
JSHint Configuration settings
/* jshint undef: true, unused: true, strict: true, curly: true, eqeqeq: true, futurehostile: true, latedef: true, shadow: outer */
/* globals $, document */
@joechan3
joechan3 / JSAndJSON.html
Last active April 23, 2016 22:47
Final Project Example from Lynda: JavaScript and JSON
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JSON Carousel</title>
<link href='http://fonts.googleapis.com/css?family=Wendy+One|Libre+Baskerville' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="mystyle.css" />
</head>
<body>
@joechan3
joechan3 / data.json
Created April 23, 2016 20:00
Using jQuery to parse JSON feeds From: Lynda - JavaScript and JSON
{
"full_name" : "Ray Villalobos",
"title" : "Staff Author",
"links" : [
{ "blog" : "http://iviewsource.com" },
{ "facebook" : "http://facebook.com/iviewsource" },
{ "podcast" : "http://feeds.feedburner.com/authoredcontent" },
{ "twitter" : "http://twitter.com/planetoftheweb" },
{ "youtube" : "http://www.youtube.com/planetoftheweb" }
]
@joechan3
joechan3 / accessingObjectsInArrays.html
Last active April 23, 2016 17:18
Accessing objects in arrays From: Lynda - JavaScript and JSON
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JavaScript And JSON</title>
</head>
<body>
<h2>Links</h2>
<ol id="links">
@joechan3
joechan3 / loopingJSObjects.html
Created April 23, 2016 17:04
Looping through JavaScript objects From: Lynda - JavaScript and JSON
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JavaScript And JSON</title>
</head>
<body>
<h2>Links</h2>
<ul id="links">
</ul>
@joechan3
joechan3 / prototype.htm
Created April 23, 2016 04:46
Prototype Example from Lynda: JavaScript Essential Training
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="mainContent">
<h1>Prototype Example</h1>
</div>