Skip to content

Instantly share code, notes, and snippets.

@JoeShep
JoeShep / functions.js
Created October 17, 2016 15:39
Functions intro
// Performs an action, but caluculates/returns no value
// console.log(returnNothing());
var returnNothing = function() {
console.log("I don't return anything");
};
// returnNothing();
// Does a task and returns the result of that task
var result = addStuff();
module.exports = function(grunt) {
grunt.initConfig({
// Change the b-fy task to add a transform task
browserify: {
js: {
src: ['./js/main.js'],
dest: 'dist/app.js'
},
options: {
{
"name": "hbs_browserify-grunt",
"version": "0.1.0",
"devDependencies": {
"browserify": "^13.0.0",
"grunt": "^0.4.5",
"grunt-browserify": "^5.0.0",
"grunt-contrib-handlebars": "^1.0.0",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-nodeunit": "~0.4.1",
@JoeShep
JoeShep / index.html
Created June 20, 2016 16:12
jQuery Intro
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<h3>A list of things</h3>
@JoeShep
JoeShep / main.js
Created June 8, 2016 15:02
Sandwich Maker example
console.log(Sandwich);
var sandwichCost = Sandwich.getSandwichPrice("cheese");
var toppingCost = Sandwich.getToppingPrice("captainCrunch");
var output = document.getElementById("sandwich");
output.innerHTML = sandwichCost + toppingCost;
@JoeShep
JoeShep / index.html
Created May 9, 2016 15:42
jQuery Playground
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<h3>A list of things</h3>
@JoeShep
JoeShep / GULP.md
Created April 25, 2016 22:14
Simple Gulp jshint watcher

Install required NPM modules in the directory

npm install gulp jshint gulp-jshint jshint-stylish gulp-watch

Create your gulpfile.js and paste in the following code

var gulp = require('gulp');
@JoeShep
JoeShep / objects.js
Created April 13, 2016 22:00
Objects 101
All the values in these objects happen to be strings ("Carly Rae Jepsen", "Livin on a Prayer", etc), but values can be any data type:
String, array, boolean, null, undefined, even other objects.
@JoeShep
JoeShep / this.js
Created April 11, 2016 23:42
This is this, or something
//******************************************************************************************************************
// This will break if you run it as is. You have to commment out all of the sections except the one you want to run.
//******************************************************************************************************************
/*
Example one: call site and call stack
*/
<!DOCTYPE html> <!-- tells browser what version-->
<html>
<head> <!-- header info, styles, meta etc-->
<meta charset="UTF-8"> <!-- define alphabet-->
<meta name="author" content="Joe Shepherd"> <!-- Define Page author -->
<title>Hi there</title> <!--tab title-->
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body><!-- displays the page-->
<nav>