This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* demo app that uses the inline directive */ | |
var myApp = angular.module('inlineDemo', ['inline']); | |
myApp.config(function ($routeProvider) {}); | |
myApp.controller('names', function ($scope) { | |
console.log('controller'); | |
$scope.masterName = $scope.name = '46'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Andrew Mead | |
* | |
* object.reduce(objToMatch) | |
* | |
* A simple way to return specific properties from an object | |
* | |
* EXAMPLE | |
* var obj = { | |
* name: "andrew", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<!-- I ran with php -S localhost:3007 --> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="./angular.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express() | |
app.configure(function () { | |
app.use(express.static(__dirname + '/app')); | |
}); | |
app.listen(3003, function () { | |
console.log('listening on port 3003'); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ============================================================================= | |
Fluid Center | |
========================================================================== */ | |
// Given the following DOM structure, elements are centered relative to the parent | |
// and can accomodate varied-width inner content | |
// <div class="fluid-center"> | |
// <div class="inner-wrap"> | |
// <div class="offset"> | |
// Any content here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.watch('public/js/main.js', ['scripts']).on('change', function () { | |
// I would expect the scripts task to be done | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getQueryVariable(variable) { | |
var query = window.location.search.substring(1); | |
var vars = query.split('&'); | |
for (var i = 0; i < vars.length; i++) { | |
var pair = vars[i].split('='); | |
if (decodeURIComponent(pair[0]) == variable) { | |
return decodeURIComponent(pair[1]); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(sequelize, DataTypes) { | |
return sequelize.define('todo', { | |
description: { | |
type: DataTypes.STRING, | |
allowNull: false, | |
validate: { | |
len: [1, 250] | |
} | |
}, | |
completed: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
fs.writeFileSync('message.txt', 'Hello Node.js'); | |
console.log('This will not print until the file is saved. Sync means do not use non-blocking.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vertical-center { | |
min-height: 100vh; | |
margin: 0; | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
-webkit-box-align: center; | |
-webkit-align-items: center; | |
-ms-flex-align: center; |
OlderNewer