Skip to content

Instantly share code, notes, and snippets.

View Scarygami's full-sized avatar

Gerwin Sturm Scarygami

View GitHub Profile
@Scarygami
Scarygami / location_history_minify.py
Created November 10, 2014 11:18
location_history_minify
#!/usr/bin/env python
# Copyright 2014 Gerwin Sturm, FoldedSoft e.U. / www.foldedsoft.at
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
<polymer-element name="demo-element">
<template>
<paper-toggle-button checked="{{a}}"></paper-toggle-button>
<paper-toggle-button checked="{{b}}"></paper-toggle-button>
</template>
<script>
Polymer({
a: false,
b: false,
aChanged: function () {
@Scarygami
Scarygami / QuickStats.gs
Created April 8, 2015 17:36
G+ Quick Stats
/**
* Creates a menu entry in the Google Sheets UI when the document is opened.
*/
function onOpen(e) {
SpreadsheetApp.getUi().createAddonMenu()
.addItem('Start', 'showSidebar')
.addToUi();
}
/**
@Scarygami
Scarygami / rick-roll.html
Created April 10, 2015 19:52
Auto-Rickroller
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/google-signin/google-signin.html">
<link rel="import" href="../bower_components/paper-shadow/paper-shadow.html">
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/google-apis/google-client-api.html">
<polymer-element name="rick-roll">
<template>
@Scarygami
Scarygami / necessary_client.html
Last active July 14, 2018 08:36
Google Sign-In 2.0 Server-side samples
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Google Sign-in 2.0 - Necessary Client</title>
<script src="https://apis.google.com/js/client:platform.js?onload=clientLoaded" async defer></script>
</head>
<body>
<button id="enable_offline_access">Enable Offline Access</button>
@Scarygami
Scarygami / hangout-app-new.html
Created May 18, 2015 13:55
hangout-app 0.9 release
<dom-element id="demo-hangout-app">
<template>
<hangout-app on-ready="readyCallback">
<h1>My Hangout App</h1>
</hangout-app>
</template>
</dom-element>
<script>
Polymer({
@Scarygami
Scarygami / with-debounce
Last active December 8, 2017 20:03
Polymer debounce sample
Polymer({
is: 'with-debounce',
properties: {
property1: {
type: String,
observer: '_doSomething'
},
property2: {
type: String,
observer: '_doSomething'
@Scarygami
Scarygami / request-data-binding1.html
Last active August 29, 2015 14:22
Data binding vs. event handling
<dom-module id="request-data-binding1">
<template>
<discovery-api-elements
name="plus" version="v1"></discovery-api-elements>
<google-signin
client-id="..."
scopes="..."
is-authorized="{{isAuthorized}}"></google-signin>
gulp.watch(['dev/**'], $.batch(function (events, cb) {
var paths = [];
events.on('data', function (evt) {
paths.push(evt.path);
}).on('end', function () {
lr.changed({
body: {
files: paths
}
});
@Scarygami
Scarygami / gulp-bower.js
Last active August 29, 2015 14:26
Custom elements for Chrome Apps APIs
// take all bower dependencies
gulp.src(['bower_components/**/*'])
// run all html files through crisper for CSP
.pipe($.if('*.html', $.crisper()))
// put everything into ./{{dest}}/components/
.pipe(gulp.dest(path.join(destDir, 'components')));