Skip to content

Instantly share code, notes, and snippets.

View alliwalk's full-sized avatar

Allison Walker alliwalk

View GitHub Profile
@alliwalk
alliwalk / index.html
Created April 3, 2019 21:52
SugarSugar Project: "Homer's Paradise"
<body>
<div class="pink">
<!-- <div class="details">
<p>"Homer's Paradise"</p>
</div>
-->
<!-- add candy + drift -->
@alliwalk
alliwalk / dbhelper_v4.js
Created September 11, 2018 02:48
Uncaught (in promise) DOMException: Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key. / Uncaught (in promise) TypeError...
/* Common database helper functions. */
var dbPromise = idb.open('restaurant-idb', 1, upgradeDb => {
if (!upgradeDb.objectStoreNames.contains('restaurants')) {
const foodOs = upgradeDb.createObjectStore('restaurants', {keyPath: 'id', autoIncrement: true});
foodOs.createIndex('rest_name', 'name', {unique: true});
foodOs.createIndex('boro_name', 'neighborhood', {unique: false});
foodOs.createIndex('cuis_name', 'cuisine_type', {unique: false});
}
console.log("ObjectStore: Created restaurants");
@alliwalk
alliwalk / dbhelper_v3.js
Created September 9, 2018 18:11
Restaurant Review P2: working on getting data out of ObjStore and displaying on screen.
/* Common database helper functions. */
var dbPromise = idb.open('restaurant-idb', 1, upgradeDb => {
if (!upgradeDb.objectStoreNames.contains('restaurants')) {
const foodOs = upgradeDb.createObjectStore('restaurants', {keyPath: 'id', autoIncrement: true});
foodOs.createIndex('rest_name', 'name', {unique: true});
foodOs.createIndex('boro_name', 'neighborhood', {unique: false});
foodOs.createIndex('cuis_name', 'cuisine_type', {unique: false});
}
console.log("ObjectStore: Created restaurants");
/**
** sails: node server
* Common database helper functions.
*/
var dbPromise = idb.open('restaurant-idb', 1, upgradeDb => {
if (!upgradeDb.objectStoreNames.contains('restaurants')) {
// debugger;
/**
* Common database helper functions.
*/
var dbPromise = idb.open('restaurant-idb', 1, upgradeDb => {
if (!upgradeDb.objectStoreNames.contains('restaurants')) {
const foodOs = upgradeDb.createObjectStore('restaurants', {keyPath: 'id', autoIncrement: true});
foodOs.createIndex('boro_name', 'neighborhood', {unique: false});
foodOs.createIndex('cuis_name', 'cuisine_type', {unique: false});
<dt class="icon-def">
<a data-icon="i" class="hoverInfo" data-tooltip-click="true" data-tooltip-content="<span class='cctt'>Description goes here...Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi beetroot carrot watercress. Corn amaranth salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke.</span>">Pockets</a>
</dt>