Skip to content

Instantly share code, notes, and snippets.

View myfonj's full-sized avatar

Michal Čaplygin myfonj

View GitHub Profile
@myfonj
myfonj / unround-everything.user.css
Created July 29, 2019 10:13
Unround everything
/* Unround everything */
*:not(#\0):not(#\0):not(#\0),
*:not(#\0):not(#\0):not(#\0)::before,
*:not(#\0):not(#\0):not(#\0)::after,
/* Unround images */
img:not(#\0):not(#\0):not(#\0) {
border-radius: 0 !important;
}
/**
* @returns {"not empty string"|false}
*/
function stringOrFalse() {
return Math.random() > 0.5 ? 'not empty string' : false
}
var stringVar = 'aaa'
var booleanVar = true
/*
* Bookmarklet for viewing source in iPad Safari
*/
javascript:(function(d,t){
d.write(t);
d.close();
d.body.appendChild(d.createTextNode(document.documentElement.outerHTML));
})(window.open('about:blank').document,'<!DOCTYPE html><title>Source of ' + location.href + '</title><meta name="viewport" content="width=device-width" /><body style="font-family: monospace, monospace; white-space: pre-wrap;">');
@myfonj
myfonj / tasks.jsonc
Last active July 30, 2019 08:37
VS Code HTML Tidy task
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
/*
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@namespace html url(http://www.w3.org/1999/xhtml);
(still on dev edition)
*/
/*
prevent bright new tab flash
https://www.reddit.com/r/firefox/comments/8h3gy8/trying_to_customize_newtab_in_usercontentcss_and/
*/
@myfonj
myfonj / ana-tudor-s-morph-svg-grid-smil-variation.markdown
Last active June 9, 2019 16:41
Ana Tudor's "Morph SVG grid" - SMIL variation

Ana Tudor's "Morph SVG grid" - SMIL variation

Based on Ana's pen [1], rewritten into "more pure SVG" to get wider browser support: should work in most non-IE browsers [2].

[1] https://codepen.io/thebabydino/pen/yQewOm [2] https://caniuse.com/#feat=svg-smil Original description:

Codevember #8/ 2018. Chrome only, as it sets the path data d from the CSS. If you like my work in general and this demo in particular and you wish me to be able to continue putting out stuff, please consider one of the following:

@myfonj
myfonj / align-to-physical-point-from-150-percent-scale.user.css
Last active August 6, 2019 11:16
Rescale images to physical points
/*
Crisp up-scaled images on display with 150% DPI scale factor
Prevents blurry antialised edges between picture sampling areas.
"DPI Zoom (scale) factor" can be obtained with JavaScript:
window.devicePixelRatio
for 150% DPI scale factor at page with 100% zoom level this should be 1.5
@myfonj
myfonj / mirror.bat
Created March 22, 2019 10:20
wget website mirror
rem based on https://www.reddit.com/r/DataHoarder/comments/8uirgp/httrack_vs_scrapy_vs_hamster_vs_wget/e1g0dlz/
pushd C:\web-root\offline-mirror
wget ^
--adjust-extension ^
--span-hosts ^
--convert-links ^
--backup-converted ^
--page-requisites ^
--trust-server-names ^
--no-check-certificate ^
@myfonj
myfonj / 0_html-sandbox-2.0.6.datauri.txt
Last active April 19, 2025 15:58
HTML sandbox - editor in data URI 1176 b, with live preview and persistence.
data:text/html;charset=utf-8;verbatim,<!doctype html><html style="color-scheme:dark light"><title>HTML sandbox 2.0.6</title><meta name=viewport content=width=device-width,initial-scale=1><body style=margin:0;display:flex;height:100vh onload="OT=(DC=document).title,H=(L=location).hash.slice(1)||'',RX=/(^data:.+?(;verbatim)?,)?([^]*)/,A.value=H.match(RX)[2]?H:decodeURIComponent(H)||A.value;T=W=0;E=RegExp('^'+(D='data:text/html;charset=utf-8,'));F=()=>{if(W!=(V=A.value))W=V,M=V.match(RX),I.src=M[2]?V:(M[1]||D)+encodeURIComponent(M[3]),DC.title=NT=((TM=V.match(/<title\b[^]*?\x3E([^]*?)<\/title\b/m))&&(NT=TM[1])&&(NT=NT.trim())&&(DC.title=NT+' @ '+OT))||OT};F()"><textarea autocapitalize=off style=resize:horizontal;width:50vw autofocus id=A onkeyup=clearTimeout(T);T=setTimeout(F,400) onblur=try{history.pushState({},NT,'\u0023'+(S=I.src.replace(E,'')))}catch(e){L.hash=S}><!doctype html><html lang="en" style="color-scheme: dark light;">%0A<meta name="viewport" content="width=device-width, initial-scale=1">%0A<title>%
@myfonj
myfonj / say.html.datauri.txt
Last active August 4, 2023 14:30
US & GB word pronunciation audio tester Google Dictionary (from Oxford recordings databank)
data:text/html,%3C!doctype%20html%3E%3Chtml%20lang=en%3E%3Ctitle%3EUS-GB%20pronunciation%202.0%3C/title%3E%3Cmeta%20name=viewport%20content="width=device-width,%20initial-scale=1"%3E%3Cbody%20onload=x='https://ssl.gstatic.com/dictionary/static/sounds/20160317/'%20text=snow%20bgcolor=black%3E%3Cbutton%20onfocus=this.click()%20onclick=(e=this.firstChild).src=x+i.value+'--_us_1.mp3';e.play()%3E%3Caudio%20onplay=i.focus()%3E%3C/audio%3EUS%3C/button%3E%3Cinput%20id=i%20autocapitalize=off%20placeholder=(shift+)tab%20value=honest%3E%3Cbutton%20onfocus=this.click()%20onclick=(e=this.firstChild).src=x+i.value+'--_gb_1.mp3';e.play()%3E%3Caudio%20onplay=i.focus()%3E%3C/audio%3EGB%3C/button%3E