Skip to content

Instantly share code, notes, and snippets.

@waako
waako / .gitignore
Created July 31, 2012 13:59
Drupal, SASS and ST2 gitignore file
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
sites/sites.php
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
# Ignore Sublime Text 2 local project files
*.sublime-project
@waako
waako / configuration.yaml
Created November 26, 2024 10:18
Hitachi Yutaki S heatpump Modbus integration for Home Assistant
homeassistant:
packages: !include_dir_named integrations
input_select: !include_dir_merge_named entities/input_select/
template: !include_dir_merge_list entities/template/

Testing only

This is just example to embed.

@waako
waako / domains.sh
Last active March 19, 2023 03:37
Lookup A-record and Nameservers for a list of domains in a txt file, output into a csv file
#!/bin/bash
# Put all the domain names in domains.txt, one per line
# then run in the terminal: bash domains.sh
# this will print each domain in the terminal as it looks it up
# The result csv will contains the domain, IP & Nameservers in each column
# Give each column the relevant header titles
echo "Domain Name,IP Address,Nameserver,Nameserver,Nameserver,Nameserver,Nameserver" > domains.csv
while read domain
@waako
waako / rowspan.js
Created February 24, 2023 16:03 — forked from erd0s/rowspan.js
Turn an HTML table with rowspans into a csv with rowspan data duplicated
var rows = document.querySelectorAll("table div table > tbody tr");
var records = [];
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
var cells = row.querySelectorAll("td");
cells.forEach((o, j) => {
// Put in the forward rows data
if (o.rowSpan > 1) {
@waako
waako / thermostat.yaml
Last active February 7, 2023 10:25 — forked from Cadair/thermostat.yaml
esphome configuration for my Open Energy Monitor thermostat
# This is an esphome configuration file for the OpenEnergyMonitor Thermostat
# The primary objectives of this configuration file are:
# 1) The temperature used as the sensor for the thermostat should be read from
# homeassistant, this lets you use an average or change the room the
# temperature is based on depending on the time of day etc.
# 2) If homeassisant goes offline the thermostat keeps working.
# To this end there is a sensor "average_temperature" which is recieved from hass
# and a second sensor "combined_temperature" which decides based on if a device
# is connected to the native API or not to use this sensor or the local sensor
# attached to the thermostat.
@waako
waako / themename.theme.php
Created June 19, 2016 16:48
Drupal 8: get a block's parent node title and absolute url and pass it as variable
<?php
/**
* Implements hook_preprocess_HOOK() for block.html.twig.
*/
function themename_preprocess_block(&$variables) {
// Get Title of Block's parent Node.
$request = \Drupal::request();
$route_match = \Drupal::routeMatch();
@waako
waako / .htaccess
Created July 14, 2016 15:16
redirect all traffic to https, except one page, and ensure that page is served on http
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/who-we-are/careers$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Ensure that Careers page is not forced over HTTPS
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/who-we-are/careers$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@waako
waako / babel.config.js
Last active October 20, 2020 09:29 — forked from zkat/index.js
npx is cool
{ "comments": false, "minified": true, "plugins": [ "minify-mangle-names", "transform-merge-sibling-variables", "transform-minify-booleans", "transform-remove-console" ], "presets": [ [ "@babel/preset-env", { "targets": { "ie": "11" } } ] ] }
@waako
waako / _info.md
Last active April 6, 2020 14:14 — forked from niallsmart/copy-checklist.js
Copy Card title, url, attachments and checklists to clipboard

Copy Trello card elements to clipboard in Markdown format

Instructions

  1. Open trello card in browser
  2. Open browser devtools to console tab
  3. Paste copy-card-info.js contents into console
  4. Run script
  5. Card information written to clipboard