Skip to content

Instantly share code, notes, and snippets.

View CodeDraken's full-sized avatar

CodeDraken

View GitHub Profile
@threepointone
threepointone / for-snook.md
Last active August 13, 2026 13:11
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@CodeDraken
CodeDraken / udemy-get-createdDate.js
Last active July 22, 2021 18:09
Run this on a course page to get the date the course was created and last updated.
function getCourseId() {
const courseEl = document.querySelector("body#udemy");
if (!courseEl) throw new Error("Must be on a Udemy course page!");
const id = courseEl.dataset.clpCourseId;
if (!id) {
// for active course
const secondaryId = document.querySelector("#udemy > div.main-content-wrapper > div.main-content > div").dataset.moduleArgs;