Skip to content

Instantly share code, notes, and snippets.

View adamscybot's full-sized avatar

adamscybot adamscybot

View GitHub Profile
@adamscybot
adamscybot / README.MD
Last active April 25, 2025 23:06
"LG+Sonos" optimized pipeline. Conditionally does non, either or both of: 1) Transcodes audio codecs that are incompatible with Sonos. 2) If input contains DV profile 8, but container is not mp4, changes container to mp4 such that DV will work on LG for this file -- ONLY if it comes at no cost to anything else (e.g. subs, audio)

ju

@adamscybot
adamscybot / Zotac Amp Extreme SignalRGB Component.md
Last active April 21, 2025 02:08
Zotac RTX 5000 Series Amp Extreme - Vertical Mount - SignalRGB Component

SignalRGB Component For Vertically Mounted Zotac 5000 Series Amp Extreme

Custom LED arrangement for a vertically mounted Zotac 5000 series "Amp Extreme" card connected to ARGB.

This positions everything such that it works how you expect it to on SignalRGBs 2D canvas.

If you have a horizontally ("normally") mounted card this profile isn't for you out of the box, but someone can easily use the data contained within the JSON to dervive one for that, I'm just too lazy as mine is vertical :D.

Installation

@adamscybot
adamscybot / Cypress isEqualNode.ts
Last active November 2, 2024 00:11
Cypress example to check if a set of elements changed in a meaningful way via `isEqualNode`. Useful for detecting a change in a list of elements (positionally) according to each of their defining characteristics. Avoids detecting recreated/change elements that are really the same (e.g. ignore attr order, like for like replacements)
// This method of detecting changes in a list of elements is a sledgehammer and probably memory intense if your DOM is already memory intense.
// But leaning on the semantics of the web platforms `isEqualNode` is useful if those semantics are what you are after.
//
// The semantics are much closer to a "meaningful change" than comparing element references. But dont go all the way to
// a "user visible change" guarantee since that depends if things like certain possible attribute changes amount
// to a visible change in your app.
//
// It differs from the usual way of detecting changes (which should remain the usual, this gist is for edge cases). The
// usual way being targetted comparison of some individual aspects of the elements, e.g. visible text. The difference is
// that this is a good middle ground for detecting "any characteristic change" of an element in cases where perhaps you need
@adamscybot
adamscybot / usePercentageColumns.js
Created August 18, 2020 11:36
Reac table v6 percentage column width plugin hook
/**
* This plugin hook for React table provides the ability for percentage
* widths to be provided in the column definitions, whilst maintaining the
* ability to resize those columns.
*/
export const usePercentageColumns = hooks => {
hooks.useInstance.push(useInstance)
hooks.getRowProps.push(getRowStyles)
hooks.getHeaderProps.push(getHeaderProps)
hooks.getCellProps.push(getCellProps)
@adamscybot
adamscybot / get-balance.js
Created June 30, 2014 20:29
Retrieve total balance of student loan from student finance direct pages
// First go to https://secure.studentfinance.direct.gov.uk/ and log in.
// Now go to https://secure.studentfinance.direct.gov.uk/customer/payments/view?service=direct/1/Home/listPayments_TablePages.pages_linkPage&sp=AHome%2FlistPayments_TableView&sp=1
// Now open the console and put in:
//
// var jq = document.createElement('script');
// jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
// document.getElementsByTagName('head')[0].appendChild(jq);
// jQuery.noConflict();
//
// Press enter.
@adamscybot
adamscybot / 3-layer-resource-api.py
Created February 14, 2012 16:29
Bug when posting 3-layer resource
class ServiceResource(ModelResource):
manager = fields.ToOneField(UserResource, 'manager',full=True)
area = fields.ToOneField(AreaResource, 'area',full=True)
specification = fields.ToManyField('services.api.ServiceSpecResource','servicespec_set',full=True)
class Meta:
queryset = Service.objects.all()
resource_name = 'service'
class ServiceSpecResource(ModelResource):
service = fields.ToOneField(ServiceResource,'service')