Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / eat_my_shorts.txt
Created January 5, 2023 01:55
Eat My Shorts - Block Youtube Shorts with uBlock Origin
! youtube shorts
www.youtube.com###guide-content #endpoint[title="Shorts"]:upward(ytd-guide-entry-renderer)
www.youtube.com###items #endpoint[title="Shorts"]:upward(ytd-mini-guide-entry-renderer)
www.youtube.com##ytd-browse ytd-grid-video-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer:has-text(/\s(0:\d\d|1:0\d)\s/))
www.youtube.com##ytd-browse ytd-rich-item-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer:has-text(/\s(0:\d\d|1:0\d)\s/))
www.youtube.com##ytd-search ytd-video-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer:has-text(/\s(0:\d\d|1:0\d)\s/))
www.youtube.com##ytd-watch-next-secondary-results-renderer ytd-compact-video-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer:has-text(/\s(0:\d\d|1:0\d)\s/))
www.youtube.com##ytd-browse ytd-grid-video-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer[aria-label="Shorts"])
www.youtube.com##ytd-browse ytd-rich-item-renderer:has(span.ytd-thumbnail-overlay-time-status-renderer[aria-label="Shorts"])
www.y
@squarism
squarism / typescript_enums_are_cursed.ts
Created January 3, 2023 19:36
Typescript Enums are Cursed
// Theo's Enum Avoidance, Implemented
// https://www.youtube.com/watch?v=Anu8vHXsavo
// don't do this ---------------------------------------------------
enum UserRole {
User,
Admin,
Staff
}
HTTP Verb   Route            Model->method()   Description
-----------------------------------------------------------------------------------------
GET         /posts           posts->index()    display a list of all posts
GET         /posts/new       posts->new()      return an HTML form for creating a new post
POST        /posts           posts->create()   create a new post
GET         /posts/:id       posts->show()     display a specific post
GET         /posts/:id/edit  posts->edit()     return an HTML form for editing a post
PATCH/PUT   /posts/:id       posts->update()   update a specific post
DELETE /posts/:id posts->destroy() delete a specific post
@squarism
squarism / typescriptreact.json
Last active November 20, 2022 19:10
React Snippets
{
// for next, remix and solid index routes that uses the directory name for the component name
"export default function": {
"prefix": "edf",
"body": [
"export default function ${TM_DIRECTORY/^.+\\/(.*)$/${1:/pascalcase}/}() {",
"\treturn(",
"\t\t${0}",
"\t)",
"}"
@squarism
squarism / remix_notices.ts
Created November 11, 2022 21:45
How to do flash messages or notices or toasts in remix
// app/services/notice.server.ts
const { getSession, commitSession, destroySession } =
createCookieSessionStorage({
cookie: {
name: "notice",
sameSite: "lax",
path: "/",
httpOnly: true,
secrets: [process.env.COOKIE_SECRET || "CHANGEME"],
secure: process.env.NODE_ENV === "production",
@squarism
squarism / remix_on_bun.md
Last active November 6, 2022 19:20
Remix on Bun

Not a whole lot of info out there about this. I understand that bun is in beta at the moment. I just wanted to see where it's at. Remix doesn't really care too much about the runtime since it's tied to standard APIs. However, it's still SSR so ... how to run in prod etc?

Install Bun

bun.sh has the instructions but basically run the curl/bash one-liner command even if you are on zsh or fish.

bun --version
0.2.2
@squarism
squarism / remix_thoughts.md
Last active November 14, 2022 22:31
Thoughts on Remix So Far

Caveats and Disclaimers

  • I'm biased and unperfect
  • Remix 1.7.2 is the current release, things may change
  • Making a framework is harder than I know. Making it fully featured is even harder.

The Good

It embraces web standards

@squarism
squarism / mind_blowing_dev.md
Last active September 22, 2022 17:56
Mind Blowing Dev Youtube Playlist

Mind Blowing Dev Playlist

Software development or related videos with a lasting impact on me. Usually the videos have some novel idea or something very unique at the time when compared to many tech talks.

I'm describing them here for more context (what's the big deal, I've seen this) or to save you some time (for example Linus + Git at Google).

Each video is linked directly but the playlist is the thing most updated.

I can't spoil why this talk is very clever. You'll have to watch it.

@squarism
squarism / zen_progression.md
Last active September 8, 2022 17:46
Zen Progression

Zen Core Progression

A Summary of AMD's Zen Core Tick-Tock progression of multi-threading and single core performance. Each Zen generation is compared to the last one.

Taken from Broken Silicon 169.

Percentage Increases Each Ryzen Generation

| Generation | Single Threading | Multi-Threading |

@squarism
squarism / block_techlead.txt
Created September 4, 2022 22:22
Block TechLead on YouTube
! put this in your uBlock origin My Filters section
! blocking channels (as a millionaire)
youtube.com##[id^="channel-name"]:has(a[href="/c/TechLeadShow"]):upward(.ytd-item-section-renderer)
youtube.com##[id^="channel-name"]:has(a[href="/c/TechLead"]):upward(.ytd-item-section-renderer)
youtube.com##[id^="info-section"]:has(a[href="/c/TechLeadShow"]):upward(.ytd-channel-renderer)
youtube.com##[id^="info-section"]:has(a[href="/c/TechLead"]):upward(.ytd-channel-renderer)