Skip to content

Instantly share code, notes, and snippets.

@johnny5th
johnny5th / svg_img_load.js
Created September 19, 2018 19:22
SVG Image Loading
// SVG Masked Images
var masked_images = document.querySelectorAll('.svg-masked-image');
var changeHref = function(path, img_wrapper) {
var image = img_wrapper.querySelector('svg g image');
image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
};
for(let i = 0; i < masked_images.length; i++) {
let img = masked_images[i].querySelector('img');
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active December 30, 2024 20:25
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
@ValdikSS
ValdikSS / huawei-fw-list.txt
Last active April 7, 2025 15:28
Huawei firmware files found on update server
==========================================================================
DO NOT WRITE ANY QUESTIONS IN COMMENTS
==========================================================================
This is not appropriate place for discussions. Keep this list FW-only.
I do NOT have any firmware files apart from published here or on 4pda. Please do not contact me for firmware files requests.
This is a list of files found on Huawei update server by brute-forcing URL parameters.
Some firmware files have changelogs. Just change file name to "changelog.xml" in the end of the URL.
@dehnio
dehnio / README.md
Last active May 28, 2017 17:38
Hourly ON/OFF Week Scheduler Dashboard - DEHN.IO v0.1

This allows users to set up a 24h scheduler for each day of the week in a quick and easy way.

It is a customization of robertsLando Temperature/ON-OFF Week Scheduler UI-Template Node-Red Dashboard, which is a customization of Peter Scargill Thermostat Weekend, so all credits goes to those two.

You should edit the backup & Restore File Nodes to point where you will save the setting and then create the file in that folder.

Fixed the 9 hour bug in the original from robertsLando and translated it to english.

scheduler

{% set image_file_path = content.field_teaser_image[0]['#media'].field_media_image.entity.uri.value %}
{% set image_file_alt = content.field_teaser_image[0]['#media'].field_media_image.0.alt %}
<div class="teaser__image">
{% if node.field_teaser_image_style.value == 'portrait' %}
<a href="{{ url }}">
<img src="{{ image_file_path | image_style('portrait_teaser') }}" alt="{{ image_file_alt }}">
</a>
{% endif %}
@robertsLando
robertsLando / README.md
Last active September 27, 2021 09:09
Temperature/ON-OFF Week Scheduler UI-Template Node-Red Dashboard

This allows users to set up a 24h scheduler for each day of the week in a quick and easy way.

It is a customization of Peter Scargill Thermostat Weekend so all credits goes to him.

In the Comment node you can find instructions on how to create more schedulers in the same UI, just need to copy/paste the flow of a single scheduler and find/replace the name of variables listed in the Comment node.

UI Preview

alt text

@thiamsantos
thiamsantos / links.js
Created February 21, 2017 00:14
Social Media Sharing URLS
@pjcdawkins
pjcdawkins / .gitlab-ci.yml
Last active January 24, 2025 13:08
GitLab - Platform.sh CI scripts
stages:
- review
- cleanup
variables:
# The Platform.sh project ID.
PF_PROJECT_ID: abcdefg123456
push-platformsh:
# This Docker image installs the Platform.sh CLI (and PHP, Git and SSH).
@erd0s
erd0s / rowspan.js
Last active February 24, 2023 16:04
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) {
@sgomes
sgomes / functions.scss
Last active September 27, 2022 12:36
[Using Sass to automatically pick text colors] #4 - step 2
/**
* Calculate the luminance for a color.
* See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
*/
@function luminance($color) {
$red: nth($linear-channel-values, red($color) + 1);
$green: nth($linear-channel-values, green($color) + 1);
$blue: nth($linear-channel-values, blue($color) + 1);
@return .2126 * $red + .7152 * $green + .0722 * $blue;