Skip to content

Instantly share code, notes, and snippets.

@easrng
easrng / cssmixin.js
Last active January 31, 2020 13:36
CSS Mixins, simply. No build required, and 100% valid CSS!
[ ...document.styleSheets]
.forEach(function (css) {
if(window.cssMixinDebug) window.cssMixinStart=window.performance.now();
let myRules = css.cssRules;
let mixins = {};
let mixinSelectors = {};
for (let i of myRules) {
if (i.type === 1) {
@easrng
easrng / cssmixin-demo.html
Created January 28, 2020 04:34
Demo for cssmixin.js
<!doctype html>
<meta name="viewport" content="width=device-width">
<style>
[--mixin="round-border"]{
border:1px solid black;
}
p{
--mixins:round-border;
}
</style>
@easrng
easrng / gcheck.js
Created February 1, 2020 02:05
Reverse-Engineering the Grammarly Affiliate API
async function gcheck(text){
let f=new URLSearchParams()
f.set("aff_id","1122")
f.set("offer_id","41")
f.set("source","gc")
f.set("aff_sub","gceditor")
f.set("text",text)
return JSON.parse(atob(r=new URL((await (await fetch("https://irbis.grammarly.com/api/funnels/embedded/check", {"credentials":"omit","headers":{"accept":"*/*","accept-language":"en-US,en;q=0.9","content-type":"application/x-www-form-urlencoded; charset=UTF-8","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},"referrer":"https://www.grammarcheck.net/editor/","referrerPolicy":"no-referrer-when-downgrade","body":f.toString(),"method":"POST","mode":"cors"})).json()).reportUrl).searchParams.get("alerts")))
}
onEvent("AAAAAAAAAAA", "click", function() {
var MyRandomNoun = randomNumber(1, 8);
if ((MyRandomNoun == 1)) {
setText("prompt", "plant");
}
if ((MyRandomNoun == 2)) {
setText("prompt", "fire");
}
if ((MyRandomNoun == 3)) {
setText("prompt", "earth");
@easrng
easrng / system-ui-polyfill.js
Created March 11, 2020 23:39
A polyfill for font-family: system-ui; in CSS
(() => {
let div = document.createElement("div");
div.style.font = "menu"
document.body.appendChild(div)
let font = (getComputedStyle(div).fontFamily)
div.remove()
div = null;
let sele = document.createElement("style");
sele.textContent = `@font-face {
font-family: 'system-ui';
[class*="stage-header_stage-menu-wrapper"][class*="box_box"] {
flex-direction: row-reverse;
}
[class*="gui_body-wrapper"], [class*="menu-bar_menu-bar_"] {
background: #c0c3c6;
}
[class*="menu-bar_menu-bar_"] *{
color:#4c4c4c;
background: transparent;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@easrng
easrng / letter.md
Last active July 20, 2020 21:13
open letter to the Scratch community and team

Letter to the Scratch community

Hello all! This is A-E-, and I am writing in the hopes that the ST will not continue to ignore my emails. As you may know, I formerly had bots on the Scratch website. That situation was a bad judgment call on my part, and I attempted to delete them. I deleted all but one, which the ST banned before I could delete it. Since then, I have read over the ToS and community guidelines more carefully, and will not create any more bots that could produce any kind of spam. I'd like to say the ST and I settled our differences and everything was sunshine and rainbows, but that was not the case.

A while after the @_-_F4F_-_BOT_-_ fiasco, I noticed that @DenverCoder9 was available, and I signed up with it. (For those who don't know, that name is a reference to an xkcd comic.) I received the welcome email on March 4, 2020, at 4:46 p.m. eastern time. When I log in now, I get a page saying I was banned on March 3, 2020, at 10:3

@easrng
easrng / README.md
Created May 8, 2020 00:23
Make the facebook live comments fullscreen.

Fullscreen Facebook Live Comments

Load this CSS, then delete everything still above the comments. 😄

@easrng
easrng / tib-fix.user.js
Created September 23, 2020 12:16
Fix the classroom turn in button on docs. Makes it function correctly when used with multiple accounts, and look more modern.
// ==UserScript==
// @name Turn in button fixer
// @namespace https://easrng.github.io/
// @match https://docs.google.com/*
// @grant none
// @version 1.0
// @author easrng
// @description Fix the classroom turn in button on docs. Makes it function correctly when used with multiple accounts, and look more modern.
// ==/UserScript==
const realopen=window.open;