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
// This app initially started from Flavio Copes analytics example | |
// but diverged quite a bit to generate images as well as track views | |
// https://flaviocopes.com/count-visits-static-site/ | |
const express = require('express') | |
const app = express() | |
// no db - so global var to keep track of count | |
let counter = 0 |
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
export default class extends Component { | |
state = { data: fakeData.slice(0, 10)} | |
onClick = () => { | |
this.setState({ data: fakeData.slice(10, 20)}) | |
} | |
render() { | |
return ( | |
<div> |
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
<div id="griddle-external-simulated"></div> | |
<script type="text/jsx"> | |
var externalData = fakeData.slice(0, 53); | |
var SimulatedExternalComponent = React.createClass({ | |
getInitialState: function(){ | |
var initial = { "results": [], | |
"currentPage": 0, | |
"maxPages": 0, |
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 Test = | |
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) |
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 foodApp = angular.module('foodApp', ['ngResource']); | |
foodApp.factory('Food', ['$resource', function($resource){ | |
return $resource('/food/:id', {id:'@id'}, { update: {method:'PUT' } } ); | |
}]); | |
foodApp.config(['$routeProvider', function($routeProvider) { | |
$routeProvider | |
.when('/food', {templateUrl: '/templates/list.html', controller: FoodController}) | |
.when('/food/edit/:id', {templateUrl: '/templates/edit.html', controller: FoodController}) |
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
<h1 id="header"> | |
Food Inventory | |
</h1> | |
<div id="content" ng-controller="FoodController"> | |
<div class="filter"> | |
<label for="filter">filter:</label> | |
<input type="text" name="filter" ng-model="filter" /> | |
</div> | |
<table> | |
<thead> |
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
/*--------------------- | |
:: Food | |
-> model | |
---------------------*/ | |
module.exports = { | |
attributes : { | |
name: 'STRING', | |
type: 'STRING', | |
expiration: 'DATE', | |
quantity: 'STRING', |