Skip to content

Instantly share code, notes, and snippets.

View myfonj's full-sized avatar

Michal Čaplygin myfonj

View GitHub Profile
@myfonj
myfonj / index.css
Created December 19, 2019 09:12
Test Gistpad web playground
‎‎​
@myfonj
myfonj / assorted-code-snippets.md
Last active April 29, 2021 13:37
Assorted code snippets

.

@myfonj
myfonj / user.js
Last active January 9, 2020 13:52
Firefox most importart user prefs
user_pref("accessibility.typeaheadfind.flashBar", 0);
user_pref("browser.ctrlTab.recentlyUsedOrder", false);
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.startup.page", 3);
user_pref("browser.altClickSave", false);
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.tabs.insertAfterCurrent", true);
user_pref("browser.tabs.selectOwnerOnClose", false);
user_pref("browser.urlbar.clickSelectsAll", false);
user_pref("browser.urlbar.filter.javascript", false);
@myfonj
myfonj / _userChrome.css
Last active July 24, 2023 23:38
My userChrome for Firefox Developer edition
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
@namespace svg url("http://www.w3.org/2000/svg");
/*
userChrome.css
version: 2023-07-25
https://gist.github.com/myfonj/f5415dd0580663a82ea18407ef2ee5de/edit
§ HOWTO (Firefox ~88):
@myfonj
myfonj / poc.js
Created September 23, 2019 22:18
youtube set scrobbling POC
(function(){
// document.getElementById('more').dispatchEvent(new Event('click'));
// seems it is not necessary after all; description is already present
let c = document.getElementById('description');
var ts = Array.from(c.querySelectorAll('a[href^="/"][href*="&t="]'))
.map(
a=>[
a.getAttribute('href').match(/&t=([^&]*)/)[1], // seconds
a.nextSibling.textContent.trim().split('\n')[0] // title
]
@myfonj
myfonj / twitter-com-un-trim-images-on-hover.user.css
Last active May 15, 2020 19:40
Twitter.com: un-trim images on hover
@-moz-document domain("twitter.com") {
/*
Twitter.com: un-trim images on hover
div[aria-label^="Timeline: "] > div > div > div
= "post item"
*/
/*
let the spice flow. over.
*/
@-moz-document url-prefix("file:///"), url-prefix("http://"), url-prefix("https://"), url-prefix("data:text/html,"), url-prefix("data:text/html;charset=utf-8,<!DOCTYPE%20html><title>HTML%20sandbox%20") {
/* AGENT_SHEET */
/*
"myfavolours" - global custom colour scheme
http://userstyles.org/styles/2187
BEGIN
*/
/* i really want this to be global */
/*
summary:
(function(){
/*
data extracted from https://unicode.org/Public/emoji/12.0/emoji-test.txt
linked trough https://unicode.org/Public/emoji/12.0/
from https://unicode.org/emoji/charts/full-emoji-list.html
probably licensed under https://www.unicode.org/license.html
*/
const EMOJI_STRING = "😀|grinning face||😃|grinning face with big eyes||😄|grinning face with smiling eyes||😁|beaming face with smiling eyes||😆|grinning squinting face||😅|grinning face with sweat||🤣|rolling on the floor laughing||😂|face with tears of joy||🙂|slightly smiling face||🙃|upside-down face||😉|winking face||😊|smiling face with smiling eyes||😇|smiling face with halo||🥰|smiling face with hearts||😍|smiling face with heart-eyes||🤩|star-struck||😘|face blowing a kiss||😗|kissing face||☺️|smiling face||☺|smiling face||😚|kissing face with closed eyes||😙|kissing face with smiling eyes||😋|face savoring food||😛|face with tongue||😜|winking face with tongue||🤪|zany face||😝|squinting face with tongue||🤑|money-mouth face||🤗|hugging face||🤭|face with hand over
@myfonj
myfonj / sweep stickies bookmarklet
Last active August 16, 2019 15:52
🧹 Sweep Stickies 🧹
javascript:((u,n,s,t,i,c,k)=>n.querySelectorAll('*').forEach(e=>{true&&(/fixed|sticky/.test((c=getComputedStyle(e))[s])||(/absolute/.test(c[s])&&Number(c.zIndex)>t))&&e!==n.documentElement&&e!==(k=n.body)&&k.contains(e)&&e.parentNode.removeChild(e)||/hidden/.test(c[u])&&e.style.setProperty(u,'auto','important')}))('overflow',document,'position',1111)
@myfonj
myfonj / console-copy-computed-style-as-json.devtools.js
Last active July 30, 2019 08:59
Copy computed style as formatted JSON in Devtools console
(el=>copy(JSON.stringify((c=>Object.values(c).reduce((o,k)=>{o[k]=c[k];return o},{}))(getComputedStyle(el)),null,'\t')))(document.body)