Skip to content

Instantly share code, notes, and snippets.

@chrislaughlin
chrislaughlin / gist:7bf0c00d778ffe3c125f213b1b5a77c9
Created February 14, 2024 10:09
Specificity Showdown: Can You Guess the Winner?
The correct answer is A. Rule 1 (.container h2.special). Here's why:
Specificity is calculated based on the number of IDs, classes, and elements in the selector.
Rule 1 has one ID (.container), one class (.special), and one element (h2), giving it a value of 100 + 10 + 1 = 111.
Rule 2 only has one class and one element (10 + 1 = 11).
Rule 3 only has one ID and one class (100 + 10 = 110).
@chrislaughlin
chrislaughlin / pattern-matching.js
Created February 3, 2022 20:34
Pattern Matching
import flatten from 'flat';
import objPath from 'object-path';
const _matchKeys = (matchOn, matchWith) => {
const matchWithPaths = Object.keys(flatten(matchWith));
const matchWithValues = matchWithPaths.map(path => {
return objPath.get(matchWith, path);
})
const matchOnValues = matchWithPaths.map(path => {
@chrislaughlin
chrislaughlin / goals.md
Last active June 26, 2021 17:39
Belfast JS Questions Stream

Goals

Add lives questions section to belfast.js.org

TODO:

  • user can provide name (optional)
  • user can type question
  • user can up vote existing question

Nice to have

BelfastJS Speaker Guidelines

Last revised November 2018

This Gist provides some useful guidelines, advice and expectations for individuals who are speaking, or wish to speak, at a BelfastJS event.

See also our Code of Conduct.


General

BelfastJS Code of Conduct

Last updated: May 2018

BelfastJS is a JavaScript and web development meetup based in Belfast, which attracts a large contingent of attendees and speakers from across demographics and disciplines.

All organisers, speakers, sponsors, volunteers and attendees at any BelfastJS event are required to agree with the following code of conduct. Organizers will enforce this code throughout the events.

The Quick Version

  • geo
  • ram
  • storage
  • battery
  • OS
  • network
@chrislaughlin
chrislaughlin / deno-check.md
Last active February 4, 2021 19:49
Deno stream Check list

Checklist

  • Hello world Deno
  • make fetch call
  • parse data
  • get needed info
  • format date
  • return from server
@chrislaughlin
chrislaughlin / stories.md
Created November 25, 2020 17:28
Stories

Something I found earlier

<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" style="enable-background:new -580 439 577.9 194;"
      xml:space="preserve">  
      <circle cx="50" cy="50" r="40" />
    </svg>