Skip to content

Instantly share code, notes, and snippets.

View OACDesigns's full-sized avatar

Oisin Conolly OACDesigns

View GitHub Profile
@OACDesigns
OACDesigns / jinja
Created May 7, 2024 22:15
Home Assistant Template Snippets
----------------------------
List lights in an area:
----------------------------
Entity IDs:
{{
states.light
| selectattr('entity_id', 'in', area_entities('living_room'))
| rejectattr('attributes.is_hue_group', 'defined')
| map(attribute='entity_id')
| list | join(',')
@OACDesigns
OACDesigns / renew_ssl_cert.yaml
Last active February 19, 2024 11:42 — forked from mdeweerd/renew_ssl_cert.yaml
Homeassistant Blueprint for SSL-Certificate renewal
---
blueprint:
name: Renew Let's Encrypt Certificate
description: Renew Certificate when due date is below given value
domain: automation
input:
cert_expiry_sensor:
name: Certificate Expiry Sensor
description: Sensor from the Certificate Expiry Integration (https://www.home-assistant.io/integrations/cert_expiry)
selector:
@OACDesigns
OACDesigns / Keybase.md
Created September 12, 2019 07:31
Keybase.md

Keybase proof

I hereby claim:

  • I am oacdesigns on github.
  • I am oacdesigns (https://keybase.io/oacdesigns) on keybase.
  • I have a public key ASCte0VOFBPijdUvv0_m8qqGSnj8j2fn-2YuCsqlTeye8go

To claim this, I am signing this object:

function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},

Keep calm and smash it :)

var a = ['So happy to do this test', []];
console.log(a.join('!'));
<a href="bitcoin:3E8yv159rbTEirHApvq5KEHoXHqFB7oXiy?amount=1&label=blocktrail&message=Donation%20for%20project%20xyz">3E8yv159rbTEirHApvq5KEHoXHqFB7oXiy</a>
<h2>Testnet</h2>
<a href="bitcoin:2MyFs8prLkDa9ePnt5PytCmJ4tGuuVrSCJ1?amount=1&label=blocktrail&message=Donation%20for%20project%20xyz">2MyFs8prLkDa9ePnt5PytCmJ4tGuuVrSCJ1</a>
@OACDesigns
OACDesigns / gist:8ad018ae465a00954559
Created May 13, 2015 11:54
Angular WebRTC QR code scanning service
//requires jsqrcode: https://github.com/LazarSoft/jsqrcode.git
angular.module('myApp')
.service( 'QR', function($log, $q, $interval) {
var self = this;
this.canvasElm = null;
this.videoElm = null;
this.videoStream = null;
this.interval = null;
Verifying that +oisin is my Bitcoin username. You can send me #bitcoin here: https://onename.io/oisin

Page Scroll with User Override

This pen demonstrates how we can create a better user experience when scrolling the user by giving them the ability to stop it. This allows them to scroll back or interact with the page instead of having to wait for your scroll animation to end

A Pen by Oisin Conolly on CodePen.

License.

Raspberry Pi general optimization

  • Use a class 10 SD card for best speed. The USB bus can't come much higher than 30MB/s so you don't have to buy any extremely fast ones though. Not all cards are compatible, check the compatibility list: http://elinux.org/RPi_SD_cards
  • Use the HardFloat version of Raspbian instead of the SoftFloat. HF has much faster floating point operations - however SF is required for running Java. So it's either Java or performance, like normal.
  • The official Raspbian image gives low network speeds: http://elinux.org/RPi_Performance#NIC
  • A graphics driver by Simon / teh_orph is using hardware acceleration for some instructions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=28294 installation instructions: http://elinux.org/RPi_Xorg_rpi_Driver
  • The firmware can be upgraded which gives, among other things, better GPU performance.