Skip to content

Instantly share code, notes, and snippets.

View jonesnxt's full-sized avatar

Kelsey jonesnxt

  • Subsecond
  • San Diego, CA
View GitHub Profile
<link
rel="preload"
as="image"
imagesrcset="/subsecond.webp?width=414&quality=70 414w,/subsecond.webp?width=785&quality=70 785w,/subsecond.webp?width=1024&quality=70 1024w,/subsecond.webp?width=1600&quality=70 1600w"
imagesizes="100vw"
media="(-webkit-min-device-pixel-ratio: 0.1) and (-webkit-max-device-pixel-ratio: 1)"
/>
<link
rel="preload"
as="image"
cssRuleList
.flat()
.filter((rule) => rule != null && !new RegExp(/^@media.*{}$/).test(rule))
.join(' ');
Array.from(document.querySelectorAll(rule.selectorText)).some(
(node) =>
node.getBoundingClientRect().top < window.innerHeight &&
window.getComputedStyle(node).display !== 'none'
)
styleSheets.map((sheet) =>
Array.from(sheet.cssRules).map((rule) =>
rule.type === rule.FONT_FACE_RULE
? { /* include this rule */ }
: rule.type === rule.STYLE_RULE
? { /* include this rule if above-the-fold */ }
: rule.type === rule.MEDIA_RULE
? Array.from(rule.cssRules)
.map((mediaRule) =>
mediaRule.type === mediaRule.FONT_FACE_RULE
Array.from(document.styleSheets)
.filter((sheet) => {
try {
sheet.cssRules;
return true;
} catch (err) {
console.log(
`Due to CORS issues, this script can't access "${sheet.href}"`
);
return false;
Array.from(document.styleSheets).filter((sheet) => { try { sheet.cssRules; return true; } catch (err) { console.log(`Due to CORS issues, this script can't access "${sheet.href}"`); return false; }}).map((sheet) => Array.from(sheet.cssRules).map((rule) => rule.type === rule.FONT_FACE_RULE ? rule.cssText : rule.type === rule.STYLE_RULE ? Array.from(document.querySelectorAll(rule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? rule.cssText : null : rule.type === rule.MEDIA_RULE ? `@media ${rule.conditionText} {${Array.from(rule.cssRules).map((mediaRule) => mediaRule.type === mediaRule.FONT_FACE_RULE ? mediaRule.cssText : mediaRule.type === mediaRule.STYLE_RULE ? Array.from(document.querySelectorAll(mediaRule.selectorText)).some((node) => node.getBoundingClientRect().top < window.innerHeight && window.getComputedStyle(node).display !== 'none') ? mediaRule.cssText : null : null).filter((mediaRule) => mediaRule != null).join(
Array.from(document.styleSheets)
.filter((sheet) => {
try {
sheet.cssRules;
return true;
} catch (err) {
console.log(
`Due to CORS issues, this script can't access "${sheet.href}"`
);
return false;
@jonesnxt
jonesnxt / google-chat-replies.md
Last active March 11, 2021 02:54
Add a reply button to messages on google chat

Google Chat Replies

To enable:

  1. Right click google meet and click "Inspect"
  2. Go to the "Console" tab
  3. Paste the script featured below into the console
  4. Ignore the message telling you not to do this
  5. Hit enter and it should work until next time you open the app
@jonesnxt
jonesnxt / google-chat-styling.md
Created March 10, 2021 02:44
A very quickly hacked together re-styling of Google Chat

Jones Mode - Google Chat Restyle

To enable:

  1. Right click google meet and click "Inspect"
  2. Go to the "Console" tab
  3. Paste the script featured below into the console
  4. Ignore the message telling you not to do this
  5. Hit enter and it should work until next time you open the app

e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(".WQKmIb .Bl2pUd{background-color:#deeffe;padding-bottom:20px}.XbbXmb.zzVqCe+.ajCeRb:not(.zzVqCe),.WQKmIb .ajCeRb:not(.zzVqCe){border-radius:20px;border-bottom-left-radius:4px;margin-top:16px;background-color:#FFF;padding-bottom:4px;}.zzVqCe,.XbbXmb.zzVqCe{border-radius:20px;border-bottom-left-radius:4px;border-top-left-radius:4px;border-top:1px solid #eee;background-color:#FFF;padding-top:8px;padding-bottom:4px;}.YQsadf{width:42px;height:42px;border-radius:100%;}.cmEq8b .Z4BnXb .njhDLd{font-size:1.2rem}.Zc1Emd{font-size:1rem;line-height:1.6rem}.HmJAwd{width:42px;}")),document.head.appendChild(e);

function setup() {
createCanvas(window.innerWidth, window.innerHeight, WEBGL);
perspective();
}
function preload() {
img = loadImage('https://i.imgur.com/vJgD8sl.jpg');
}
const midX = window.innerWidth/2;