Skip to content

Instantly share code, notes, and snippets.

<link rel="import"
href="/components/polymer/polymer.html">
<link rel="import"
href="/public/vendor/core-firebase/core-firebase.html">
<link rel="import"
href="/public/vendor/polymer-ajax/polymer-ajax.html">
<polymer-element name="new-polymer-ajax-tag" noscript>
body {
font: 13px/20px "Lucida Grande", Tahoma, Verdana, sans-serif;
color: #404040;
background: #eee;
}
.container {
margin: 50px auto;
width: 380px;
}
<link rel="import"
href="/components/polymer/polymer.html">
<link rel="import"
href="/public/vendor/core-firebase/core-firebase.html">
<polymer-element name="new-cloud-tag">
<template>
<link href='./new-cloud-tag.css' rel='stylesheet' type='text/css'>
<link rel="import"
href="/components/polymer/polymer.html">
<link rel="import"
href="/public/vendor/core-firebase/core-firebase.html">
<polymer-element name="new-cloud-tag" noscript>
<template>
<style>
//First assignment
// Original:
https://gist.github.com/ABrouwer/9955831
//Improved version:
https://gist.github.com/ABrouwer/9955899
//Second assignment
@ABrouwer
ABrouwer / Portfolio assignment 4+5-dataset in firebase
Last active August 29, 2015 13:58
Portfolio assignment 4+5-dataset in firebase
d3.json('https://astportfoliodata.firebaseio.com/.json', function(d) {
console.log(data); //Log output to console
var dataset = data
myDataRef = new Firebase('https://astportfoliodata.firebaseio.com/.json');
//Width and height
var w = 500;
var h = 400;
@ABrouwer
ABrouwer / Portfolio assignment 4+5-dataset in code
Last active August 29, 2015 13:58
Portfolio assignement 4+5-dataset in code
var dataset = [
[30, 6.5],
[34, 8.5],
[10, 5 ],
[38, 9 ],
[22, 6.5],
[20, 7 ],
[25, 8 ],
[10, 8 ],
[17, 7.5],
@ABrouwer
ABrouwer / Portfolio assignment 03
Last active August 29, 2015 13:58
Portfolio assignment 03
localStorage.getItem('assignment'); // <-- getting assignments from local storage
JSON.parse(localStorage.getItem('assignment')); // <-- parsing data
//creating dataset
var eventsJSON = localStorage.getItem('assignment');
var events = JSON.parse(eventsJSON).events;
var data = events;
//creating w/h/padding
@ABrouwer
ABrouwer / Portfolio assignment 02
Created April 3, 2014 14:58
Portfolio assignment 02
var studentsTemplate2 ='<script id="students-template2" type="text/x-handlebars-template"><table><thead><th>Student Name</th><th>Hours of coding</th><th>Grade</th></thead><tbody>{{#students2}}<tr><td>{{name}}</td><td>{{hoc}}</td><td>{{grade}}</td></tr>{{/students2}}</tbody></table></script>';
$(".content").append(studentsTemplate2);
var studentTemplateScript2 = $("#students-template2").html();
var theStudentTemplate2 = Handlebars.compile(studentTemplateScript2);
var data2 = { students2: [
{name: "Student 01", hoc: "30", grade: "6.5"},
@ABrouwer
ABrouwer / gist:9955899
Created April 3, 2014 14:56
Portfolio assignment 01
$(function(){
var headings = $("section.assignment > h1");
var paragraphs = $("p");
paragraphs.not(":first").hide();
headings.on("mouseover", function(){
var t = $(this);
var tPara = t.next();
if(tPara.is(":visible")){
return;