Skip to content

Instantly share code, notes, and snippets.

View Tenkir's full-sized avatar
:shipit:
Ship It

Jonathan Blair Tenkir

:shipit:
Ship It
View GitHub Profile
@Security2431
Security2431 / package.json
Last active June 12, 2024 13:49
shaka-player 4.3.4.patch
{
"scripts": {
"postinstall": "patch-package"
},
"devDependencies": {
"patch-package": "6.5.1",
"shaka-player": "4.3.4"
}
}
@digitaltembo
digitaltembo / text_box.py
Created March 19, 2019 01:50
Drawing within a Text Box in Python Pillow (PIL fork)
"""
Draws the text <text> on the ImageDraw <image_draw> in the box (specified as a 4-ple of [x,y,width,height])
with the font <font> and the allignments as given. Passes other arguments to the ImageDraw.text function
(for example, fill is a good one to use here).
Can be used to center text horizontally and vertically, as well as right-align and bottom-allign (although it defaults to
left- and top-allignment). Nothing is done to prevent overflow, but the y and height values from the box will be used for vertical
allignment
Example usage:
@jonathantneal
jonathantneal / detect-autofill.js
Created September 11, 2018 14:56
Detect autofill in Chrome, Edge, Firefox, and Safari
export default scope => {
// match the filter on autofilled elements in Firefox
const mozFilterMatch = /^grayscale\(.+\) brightness\((1)?.*\) contrast\(.+\) invert\(.+\) sepia\(.+\) saturate\(.+\)$/
scope.addEventListener('animationstart', onAnimationStart)
scope.addEventListener('input', onInput)
scope.addEventListener('transitionstart', onTransitionStart)
function onAnimationStart(event) {
// detect autofills in Chrome and Safari by: