Skip to content

Instantly share code, notes, and snippets.

@nathnolt
nathnolt / show-youtube-titles.js
Last active September 25, 2022 17:30
YouTube show full video titles Chrome snippet
$$('#video-title').forEach(x => {
let sty = x.style
setStyle(x, {
overflow: 'visible',
maxHeight: 'none',
lineHeight: 1.2,
display: 'block',
})
})
@nathnolt
nathnolt / number-stringify.js
Last active March 12, 2023 21:27
Stringifies a number with all of the precision in JavaScript
function printFullFloat(number) {
var numStr = number.toFixed(100)
var index = numStr.length-1
var char = numStr.charAt(index)
while(char == '0') {
index--
char = numStr.charAt(index)
}
if(char != '.') {
index++
@nathnolt
nathnolt / .htaccess
Created June 29, 2023 20:43
Apache Rewrite to HTTPS only when supported by browser vhosts / htaccess
# I only have used it inside of my vhosts file, but I think it should also work in .htaccess
RewriteEngine on
# rewrite to https.
# -----------------
# %{HTTP:X-Forwarded-Proto} !https: This condition checks if the X-Forwarded-Proto header is not set to https.
# The X-Forwarded-Proto #header is typically set by proxies or load balancers to indicate the original protocol
# used for the request. By checking this header, # you can ensure that the redirect only occurs if the request
# is not already using HTTPS.