Skip to content

Instantly share code, notes, and snippets.

View daviddarnes's full-sized avatar
🧱
he/him

David Darnes daviddarnes

🧱
he/him
View GitHub Profile
@daviddarnes
daviddarnes / Clips.json
Created September 20, 2022 16:44
Example of clips in Nova code editor
{
"clips": [
{
"content": "The content of the $1 clip ${1:placeholder}",
"name": "Example single clip",
"syntax": "html",
"trigger": "example"
},
{
"name": "Clips group example",
Team,
There are news reports outlining claims about Twitter's privacy, security, and data
protection practices that were made by Mudge Zatko, a former Twitter executive
who was terminated in January 2022 for ineffective leadership and poor
performance. We are reviewing the redacted claims that have been published,
but what we've seen so far is a false narrative that is riddled with inconsistencies
and inaccuracies, and presented without important context.
I know this is frustrating and confusing to read, given Mudge was accountable for
many aspects of this work that he is now inaccurately portraying more than six
months after his termination. But none of this takes away from the important
@daviddarnes
daviddarnes / mutes.txt
Created August 15, 2022 09:19
Twitter mutes list
suggestrecycledtweet_inline
suggestpyletweet
suggestactivitytweet
suggest_who_to_follow
suggest_timeline_tweet
suggest_sc_tweet
suggest_recycled_tweet
suggest_recap
suggest_ranked_timeline_tweet
suggest_ranked_organic_tweet
@daviddarnes
daviddarnes / .eleventy.js
Created June 13, 2022 09:22
Compile CSS with Parcel CSS
const css = require("@parcel/css");
module.exports = (eleventyConfig) => {
eleventyConfig.addTemplateFormats("css");
eleventyConfig.addExtension("css", {
outputFileExtension: "css",
compile: (contents, inputPath) => {
return (data) => {
let ret = css.bundle({

you search "brown spotted moth southern us identify" and the results are all:

  • "Brown Moth? Here's what you need to know...
  • Ten things about Brown Spotted 😍
  • What everyone's saying about moth southern identify

and they all lead to the same 11 paragraphs of:

"Don't panic! You like many others have long desired to know more

@daviddarnes
daviddarnes / pickyeater.txt
Created May 20, 2022 13:33
1 point for every item you would NOT eat
LETTUCE
BRUSSEL SPROUTS
CABBAGE
ZUCCHINI
TOMATOES
CAULIFLOWER
COCONUT
CUCUMBER
ASPARAGUS
EGGS
@daviddarnes
daviddarnes / hexToP3.js
Created May 12, 2022 13:51
Function to turn hex colour values into p3 color values
const hexToP3 = (string) => {
var aRgbHex = string.replace("#", "").match(/.{1,2}/g);
var aRgb = [
(parseInt(aRgbHex[0], 16) / 255).toFixed(2),
(parseInt(aRgbHex[1], 16) / 255).toFixed(2),
(parseInt(aRgbHex[2], 16) / 255).toFixed(2),
];
return `color(display-p3 ${aRgb.join(" ")})`;
};
@daviddarnes
daviddarnes / script.js
Created February 8, 2022 13:10
Hide a button when an element is no longer visible in the viewport
const targetEl = document.querySelector("#theButtonOrElement");
const watchedEl = document.querySelector("#TheElementYoureWatching");
const intersectionObserver = new IntersectionObserver((entries) => {
if (entries[0].intersectionRatio > 0) {
footerTopButton.setAttribute("data-visible", false);
} else {
footerTopButton.setAttribute("data-visible", true);
}
});
@daviddarnes
daviddarnes / last-month-day.liquid
Created February 1, 2022 17:08
Calculate the last day of the month using liquid only
{%- capture current_month %}{{ site.time | date: '%m' }}{% endcapture -%}
{%- capture future_date %}{{ site.time | date: '%Y' }}-{% if current_month == 12 %}01{% else %}{{ current_month | plus: 1 }}{% endif %}-01{% endcapture -%}
{%- capture epoc_end_month_date %}{{ future_date | date: '%s' }}{% endcapture -%}
{{ epoc_end_month_date | minus: 86400 | date: "%B" }}{{ " " }}
{%- assign day = epoc_end_month_date | minus: 86400 | date: "%-d" -%}
{%- case day -%}
{%- when '1' or '21' or '31' -%}{{ day }}st
{%- when '2' or '22' -%}{{ day }}nd
{%- when '3' or '23' -%}{{ day }}rd
{%- else %}{{ day }}th
@daviddarnes
daviddarnes / clips.json
Created January 28, 2022 14:28
Example clips file for Nova editor
{
"clips": [
{
"content": "The content of the $1 clip ${1:placeholder}",
"name": "Example single clip",
"syntax": "html",
"trigger": "example"
},
{
"name": "Clips group example",