Skip to content

Instantly share code, notes, and snippets.

@Dianoga
Dianoga / hook-concat-templates
Created May 14, 2014 16:11
Codekit hook to concatenate templates into html file
php -r '
$filename = "index2.html";
$file = file_get_contents($filename);
$views = str_replace("</script>", "</script>\n", `cat views/*`);
$find = "/(<!--StartTemplates-->)(.*)(<!--EndTemplates)/s";
$replace = "$1\n{{templates}}\n$3";
$file = preg_replace($find, $replace, $file);
$file = str_replace("{{templates}}", $views, $file);
@Dianoga
Dianoga / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@Dianoga
Dianoga / ge-link-bulb.dt.groovy
Created December 8, 2014 22:46
ge-link-bulb.dt.groovy

Keybase proof

I hereby claim:

  • I am dianoga on github.
  • I am dianoga (https://keybase.io/dianoga) on keybase.
  • I have a public key whose fingerprint is 21CE 2C86 F1AB 7F45 DBD8 27F3 E7C6 0755 DB7B BB9A

To claim this, I am signing this object:

@Dianoga
Dianoga / test.groovy
Last active September 30, 2015 14:48
/**
* Test
*
* Copyright 2015 Brian Steere
*
* 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
*
@Dianoga
Dianoga / nest.device-type.groovy
Created July 1, 2013 19:06
Nest Device Type for SmartThings
/**
* Nest
*
* Author: dianoga7@3dgo.net
* Date: 2013-06-24
*/
// for the UI
metadata {
simulator {
}
@Dianoga
Dianoga / nightlight.groovy
Last active December 19, 2015 09:39
Security/Night Light SmartApp
/**
* Clever Night Light
*
* Author: Brian Steere
*/
preferences {
section("Turn on which things") {
input "switches", "capability.switch", title: "Things", multiple: true
@Dianoga
Dianoga / sunrise-sunset.groovy
Created July 5, 2013 13:35
Sunrise/Sunset Mode Changer SmartApp
/**
* Sunrise/Sunset
*
* Author: dianoga7@3dgo.net
* Date: 2013-06-26
*/
preferences {
section("Sunrise") {
input ('sunrise_mode', 'mode', title: 'Change to mode: ')
}
@Dianoga
Dianoga / hvac-autoonoff.smartapp.groovy
Created July 22, 2013 15:15
A SmartApp to automatically turn off a thermostat when contact sensors open. It will restore thermostat mode when all sensors are closed again
/**
* HVAC Auto Off
*
* Author: dianoga7@3dgo.net
* Date: 2013-07-21
*/
preferences {
section("Control") {
input("thermostat", "capability.thermostat", title: "Thermostat")
}
@Dianoga
Dianoga / 0_reuse_code.js
Created February 11, 2016 16:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console