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 April 1, 2025 19:35
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:
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],