Skip to content

Instantly share code, notes, and snippets.

View estelsmith's full-sized avatar

Estel Smith estelsmith

View GitHub Profile
@estelsmith
estelsmith / emulator.games.user.js
Last active March 29, 2021 11:22
Updates the download button on emulator.games to ROM pages to link directly to the file download
// ==UserScript==
// @name emulator.games download
// @version 0.0.2
// @description Fixes the download button on emulator.games to actually download ROMs
// @author estelsmith
// @match https://emulator.games/roms/*/*/
// @grant none
// ==/UserScript==
(function($, romId) {
@estelsmith
estelsmith / defer-js-snippets.php
Last active February 3, 2020 19:54
Helpful Code Snippets!
<?php
/**
* Plugin Name: CM Defer Inline JavaScript
* Description: Wraps all inline javascript to fire when document.readyState becomes interactive
*/
function cm_defer_js_script_wrapper()
{
$wrapper = <<<EOF
document.addEventListener('readystatechange', function () {
@estelsmith
estelsmith / README.md
Last active July 4, 2022 13:57
Attempting to do name-based FTP proxying with Traefik

This is an attempt at using TLS-SNI to provide name-based routing to independent FTP servers.

Currently it fails because, while Traefik connects to the FTP server and passes data, TLS is terminated in Traefik and the FTP server requests TLS again using 421 TLS is required, confusing the client because it's already made a TLS connection.

Not requiring TLS on the FTP server causes data-transfer connections to fail when receiving the PASV command, because the FTP server expects an unencrypted data connection, whereas the client thinks it's connected via TLS and attempts to use TLS for both the control and data connections.

Attempting to switch from TLS-termination to TLS-passthrough in Traefik results in the FTP server failing because it wasn't expecting TLS to already be set up. FTP has protocol-specific requirements for upgrading from a plaintext to TLS connection.

@estelsmith
estelsmith / dom-router.js
Last active September 14, 2024 17:58
Stupid simple DOM-router
(function (body) {
window.util = window.util || {};
window.util.DomRouter = Object.freeze({
ENTRY_COMMON: '_common',
FUNC_INIT: 'init',
FUNC_FINISH: 'finish',
execute: function (namespace, controllerName, actionName) {
const controller = namespace[controllerName];
if (controller === undefined) return;
@estelsmith
estelsmith / index.js
Last active March 8, 2021 16:44
List card URLs in Trello
(() => {
const origin = window.location.origin;
const report = [];
const ignoreLists = ['Recently Released', 'Complete'];
const board = document.getElementById('board');
const lists = board.querySelectorAll('.list');
const boardName = document.querySelector('.board-header-btn-text').textContent;
@estelsmith
estelsmith / index.js
Created February 16, 2023 21:00
Airtable Scripting - Google Natural Language Classification Test
let config = input.config({
title: 'Natural Language Classification',
description: 'Example of using Google Natural Language REST API to classify text.',
items: []
});
let apiKey = 'REDACTED'; // Provide your own API key here.
let endpoints = {
classifyText: 'https://language.googleapis.com/v1/documents:classifyText'
}
@estelsmith
estelsmith / index.js
Created February 16, 2023 21:02
Airtable Scripting - Conditionally update records based on view
let config = input.config({
title: 'Test Script',
description: 'Updates Name & Email fields on Test records to have a generic default if they are empty.',
items: []
});
let table = base.getTable('Test');
let view = table.getView('Empty Name or Email');
let result = await view.selectRecordsAsync({
@estelsmith
estelsmith / libva.spec
Last active March 6, 2023 22:59
libva specfile for almalinux 9.1
Name: libva
Version: 2.17.0
Release: 1%{?dist}
Summary: Video Acceleration (VA) API for Linux
License: MIT
URL: https://github.com/intel/libva
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.bz2
BuildRequires: libtool
@estelsmith
estelsmith / intel-gmmlib.spec
Last active March 5, 2023 23:26
intel-gmmlib specfile for almalinux 9.1
%undefine __cmake_in_source_build
Name: intel-gmmlib
Version: 22.3.3
Release: 1%{?dist}
Summary: Intel Graphics Memory Management Library
License: MIT and BSD
URL: https://github.com/intel/gmmlib
Source0: %{url}/archive/%{name}-%{version}.tar.gz
@estelsmith
estelsmith / intel-media-driver-gen8-9-10-perf.patch
Last active March 6, 2023 16:06
intel-media-driver specfile for almalinux 9.1
From a3abfe783f6404de18728394caed30dc8de44147 Mon Sep 17 00:00:00 2001
From: Jay Yang <[email protected]>
Date: Mon, 9 Jan 2023 14:45:39 +0800
Subject: [PATCH] [Media Common] SW swizzling regression fix for Gen8/9/10
Signed-off-by: Jay Yang <[email protected]>
Add sw swizzling sku for Gen8/9/10, without which there will be perf
drop because mos_gem_bo_map_unsynchronized is called.
---