Skip to content

Instantly share code, notes, and snippets.

View VandeurenGlenn's full-sized avatar
💭
I may write messy code.

Glenn Vandeuren VandeurenGlenn

💭
I may write messy code.
View GitHub Profile
@VandeurenGlenn
VandeurenGlenn / twitch-service
Created March 16, 2015 21:49
twitch-service
<link rel="import" href="..\..\bower_components/polymer/polymer.html">
<polymer-element name="twitch-service" attributes="">
<template>
<style>
.offline {
display: none;
}
</style>
<link rel="stylesheet" href="twitch-service.css">
/**
* simple JSONP support
*
* JSONP.get('https://api.github.com/gists/1431613', function (data) { console.log(data); });
* JSONP.get('https://api.github.com/gists/1431613', {}, function (data) { console.log(data); });
*
* gist: https://gist.github.com/gists/1431613
*/
var JSONP = (function (document) {
var requests = 0,
<link rel="import" href="..\..\bower_components/polymer/polymer.html">
<polymer-element name="twitch-api">
<template>
<link rel="stylesheet" href="twitch-api.css" attributes="clientId">
</template>
<script>
(function () {
Polymer({
twitchUrl: 'https://api.twitch.tv/kraken/',
function elementChildren (element) {
var childNodes = element.childNodes,
children = [],
i = childNodes.length;
while (i--) {
if (childNodes[i].nodeType == 1) {
children.unshift(childNodes[i]);
}
}
var user = {name: "dummy", uid: "demo"};
var data;
var text = "";
for (data in user) {
text += user[data];
}
@VandeurenGlenn
VandeurenGlenn / onStorage.js
Last active August 29, 2015 14:19 — forked from tomasperezv/gist:5175807
Example of listening to local storage changes
if (window.addEventListener) {
window.addEventListener("storage", onStorage, false);
} else {
window.attachEvent("onstorage", onStorage);
};
var onStorage = function(data) {
// Receive changes in the localStorage
}
// repeat x times
var quantity = 10;
for (var i = 1; i <=quantity; i++) {
console.log('Runned: ' + i + 'time(s)' );
}
<script>
var BasicElements = BasicElements || {};
/**
* @demo demo/index.html
* @polymerBehavior BasicElements.pageSelectedBehavior
*/
BasicElements.pageSelectedBehaviorImpl = {
properties: {
animate: {
type: Boolean,
@VandeurenGlenn
VandeurenGlenn / realTemplate.html
Created November 14, 2015 20:33 — forked from JanMiksovsky/realTemplate.html
Create a Polymer element using a real <template>, not a <dom-module>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="import" href="../components/polymer/polymer.html">
<template id="test-element">
Hello, <content></content>.
</template>

How to install Node.js on Chrome Os.

Prerequisites:

  • Chrome Os running in Developer Mode.
  • crouton (Chromium OS Universal Chroot Environment).

When not in Developer Mode check the official chromium poking-around-your-chrome-os-device page.

Installing

Open a command prompt