Skip to content

Instantly share code, notes, and snippets.

View mrbusche's full-sized avatar

Matt Busche mrbusche

View GitHub Profile
@busches
busches / Main.kt
Created July 20, 2021 01:59
Check if a video will play in the Pacifica
import org.w3c.dom.Document
import org.xml.sax.InputSource
import java.io.File
import java.io.IOException
import java.io.StringReader
import java.math.BigInteger
import java.util.concurrent.TimeUnit
import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.xpath.XPathConstants
import javax.xml.xpath.XPathFactory
@cfjedimaster
cfjedimaster / gist:ee4a2fd935318e29bd5364d71ea221c1
Last active August 3, 2019 02:30
Bookmarklet to gray scale images w/o alt.
javascript:(function(){
var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = "img[alt=\"\"],img:not([alt]){ filter:grayscale(100%) }";
document.body.appendChild(css);
})();
@soverby
soverby / ClientHttpPoolConfiguration.java
Last active February 27, 2024 15:54
RestTemplate backed by Apache HttpClient Connection Pool. Addresses RestTemplate HttpConnection exhaustion. Note this implementation is not route tunable and should be expanded when tuning by route is required. Example error: I/O error on POST request for "https://someendpoint": Timeout waiting for connection from pool; nested exception is org.a…
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ClientHttpPoolConfiguration {
@jeffsheets
jeffsheets / protractorFieldSelectionTest.spec.js
Created April 8, 2015 18:13
Protractor spec showing how to test for text selection inside a form input field
/**
* Initially written as a test for IE/Chrome for a bug in ui-mask.
* https://github.com/angular-ui/ui-utils/issues/302
*
* The test verifies that all of the text is selected in an input field when the field is tabbed into
*/
describe('field selection test', function () {
beforeEach (function () {
getRoute('#/app/events');
});
@ryanguill
ryanguill / dom-duplicate-element-ids-audit.js
Last active August 29, 2015 14:02
Small script that you can run in the console to see if you have more than one element with the same ID.
var allElements = document.getElementsByTagName("*"), allIds = {}, dupIDs = [];
for (var i = 0, n = allElements.length; i < n; ++i) {
var el = allElements[i];
if (el.id) {
if (allIds[el.id] !== undefined) dupIDs.push(el.id);
allIds[el.id] = el.name || el.id;
}
}
if (dupIDs.length) { console.error("Duplicate ID's:", dupIDs);} else { console.log("No Duplicates Detected"); }
anonymous
anonymous / gist:9388472
Created March 6, 2014 12:23
Summing up contextual influence on systems architecture
1. Monolithic applications and architectures can vary in their monolithness. This is an under-specified description.
2. Microservice applications and architectures can vary in their microness. This is an under-specified description.
3. Microservices and monolithic architectures have both benefits and disadvantages.
4. Organizations will exploit those benefits while working around any weaknesses.
5. Success of the business is a large influence on the exploitation of benefits and implementation and costs of workarounds.
6. All benefits and work arounds are context-sensitive. Meaning that they are both technically and socially constructed by the organization that navigates them.
7. Path dependency is a thing. History matters and manifests in these architectural decisions and evolution in an organization.
8. Patterns exist to inform practice, not dictate it. Zealous adherence to an architectural pattern brings peril when it is to the exclusion of cultural context in actual practice.
9. Architectural patterns w
@postmodern
postmodern / comment.md
Last active January 11, 2024 15:37
Crypto Privacy Copy Pasta
@markmandel
markmandel / FutureThreadedWorker.cfc
Created November 26, 2012 03:58
FutureThreadedWorker
<!---
Copyright 2012 Mark Mandel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software