This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Link On/Off State of Multiple Devices | |
description: | | |
## Link On/Off State of Multiple Devices v1.4 | |
Select multiple entities to link their on/off state. If any selected entity is turned on or off, the other selected entities will be sent a matching on or off command. | |
You can select any entity, but only entities supported by the `homeassistant.turn_on` or `homeassistant.turn_off` service calls will work. | |
### Requirements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rules: | |
* only output valid JSON | |
Example JSON action list: | |
{"action":"Example CRM: Create Lead","params":{"first_name":"str","last_name":"str","notes":"str"}} | |
Example input: add joe smith to my crm, he really loves cheese | |
Example output: {"action":"Example CRM: Create Lead","params":{"first_name":"joe","last_name":"smith","notes":"joe really loves cheese"}} | |
Real JSON action list: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# APPLICATION CODE (uses underscore.js) | |
lawnchair = new Lawnchair({}, (->)) | |
# hackery to cope with firefox and lawnchair, indexedDB not doing asnyc validation | |
# so well. If indexedDB isn't available (after doing a .open() check) then remove it | |
# from the available adapters and re-init lawnchair with a new instance. | |
# see: https://github.com/brianleroux/lawnchair/issues/189 | |
indexedDBValid = (callback) => | |
idb = window.indexedDB or window.webkitIndexedDB or window.mozIndexedDB or window.oIndexedDB or window.msIndexedDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>There is {{#article}}{{animal}}{{/article}} in the middle of the room.</div> | |
<!-- context passed as {noun: 'elephant'} --> | |
<div>There is an elephant in the middle of the room.</div> | |
<!-- context passed as {noun: 'mouse'} --> | |
<div>There is a mouse in the middle of the room.</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# accessor: returns the article "a" or "an" depending on the context string. Eg. "Computer" will return "a" | |
# and "Elephant" will return "an". Can pass a hash option `capitalize` which will capitalize the article. | |
# usage: {{#article}}string{{/article}} outputs "a string" | |
Handlebars.registerHelper "article", (options) -> | |
# options: pass `capitalize` true to get a capital article | |
string = options.fn(@) | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
vowel = false | |
letter = string.toLowerCase()[0] | |
vowel = true for v in vowels when letter == v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'use!underscore', | |
'use!backbone', | |
'mustache', | |
'text!template/header.html', | |
'text!template/loggedInLinks.html', | |
'text!template/loggedInTempLinks.html', | |
'text!template/loggedOutLinks.html', | |
'views/home/__init__', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button { | |
color: black; | |
.success { color: green; } | |
.error { color: red; } | |
.disabled { color: gray; } | |
} | |
.homepage { | |
// make the home page call to action green | |
.call-to-action { @extend button.success; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Book = new Backbone.Model.extend() | |
Paginate = | |
page: 0 | |
turnPage: () -> | |
@page += 1 | |
@fetch {data: {page: @page}} | |
book = _.extend new Book(), Paginate | |
book.turnPage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setCaret: function($el) { | |
var caret, lastCaret, | |
_this = this; | |
if (_.any(this.NO_CARET_TYPES, function(type) { | |
return type === _this.model.get('type'); | |
})) { | |
return; | |
} | |
lastCaret = this.getCaret(); | |
if (($el != null ? $el[0] : void 0) != null) { |
NewerOlder