This file contains hidden or 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
| {%- macro point_in_polygon(lat, lon, points) -%} | |
| {#- | |
| Function to check if a point is inside a polygon. | |
| :param lat: Latitude of the point | |
| :param lon: Longitude of the point | |
| :param points: The vertices of the polygon. The loop is closed automatically. | |
| :return: True if the point is inside the polygon, False otherwise | |
| Example usage: |
This file contains hidden or 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
| script: | |
| update_all_esphome_devices: | |
| alias: "Update All ESPHome Devices" | |
| sequence: | |
| - alias: "Call update.install on all ESPHome devices with available updates" | |
| service: update.install | |
| target: | |
| entity_id: > | |
| [{% for entity in states.update %} | |
| {% if entity.state == 'on' and entity.attributes.title == 'ESPHome' -%} |
This file contains hidden or 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
| input_select: | |
| playlist: | |
| name: Playlist | |
| options: | |
| - '' | |
| playlist_player: | |
| name: Playlist Player | |
| initial: None | |
| options: | |
| - None |
This file contains hidden or 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
| automation: | |
| - alias: Bathroom Window Warning | |
| initial_state: true | |
| trigger: | |
| platform: state | |
| entity_id: binary_sensor.apartment_door | |
| to: 'on' | |
| condition: | |
| condition: state | |
| entity_id: binary_sensor.bathroom_window |
This file contains hidden or 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
| commandArray = {} | |
| remoteScript = '/home/pi/domoticz/scripts/remote.sh' | |
| for deviceName,deviceValue in pairs(devicechanged) do | |
| if (deviceName=='Bravia TV') then | |
| if (deviceValue == 'On') then | |
| commandArray['TV'] = 'Set Level: 50 %' | |
| else | |
| commandArray['TV'] = 'Off' | |
| end |
This file contains hidden or 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
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'uri' | |
| imdb_url = "http://www.imdb.com/find?s=tt&q=" | |
| raise 'Not a file' unless File.file?(ARGV[0]) | |
| filename = File.basename(ARGV[0]) | |
| extension = File.extname(filename) | |
| movie = filename[/_UNKNOWN_(.+)#{extension.gsub('.','\.')}/, 1] |
This file contains hidden or 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
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |
This file contains hidden or 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
| cart_rebate_line_id |
This file contains hidden or 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
| `if [[ "${TM_SELECTED_TEXT}" != "" ]] | |
| then printf "'${TM_SELECTED_TEXT}'" | pbcopy | |
| fi`${TM_RAILS_TEMPLATE_START_RUBY_EXPR}t '${1:key}'${TM_RAILS_TEMPLATE_END_RUBY_EXPR} |
This file contains hidden or 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
| PUBLIC_KEY |
NewerOlder