Skip to content

Instantly share code, notes, and snippets.

View craigerskine's full-sized avatar
🎮
UX Designer/Developer

Craig @qrayg craigerskine

🎮
UX Designer/Developer
View GitHub Profile
@craigerskine
craigerskine / _dropbox_node_prep.scpt
Last active December 21, 2023 19:40
Force Dropbox to truly ignore node_modules using Apple Script (macOS only)
# Prep dropbox to ignore 'node_modules' in a node project
# 1. Move this script to your node project root;
# 2. Delete the existing 'node_modules' folder;
# 3. Run this script;
# 4. `npm install` as normal;
# 5. Enjoy!
tell application "Finder"
set current_path to container of (path to me) as alias
make new folder at current_path with properties {name:"node_modules"}
slugify(text) {
return text?.toString()
.toLowerCase()
.trim()
.replace(/\.+/g, '-') // . to - (this can be removed - my specific usecase)
.replace(/&/g, '-and-') // & to -and- (this can be removed - my specific usecase)
.normalize('NFKD') // unicode normalization
.replace(/[^\w\-]+/g, '') // remove other crazy chars
.replace(/\s+/g, '-') // space to -
.replace(/\-\-+/g, '-') // multiple - to single -
@craigerskine
craigerskine / alpinejs_elasticlunr.html
Last active November 2, 2023 14:13
Elasticlunr and Alpine.js
<!doctype html>
<html lang="en" class="bg-transparent antialiased" x-data="app" x-init="searchData()">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title x-text="site.title"></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link href="https://fonts.gstatic.com" rel="preconnect" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet" />
@craigerskine
craigerskine / 11ty-gh-pages.md
Created July 30, 2023 21:36
11ty + Github Pages

11ty + gh-pages

  • Add empty .nojekyll to root.
  • Add scripts command "build": "eleventy" in package.json.
  • Add workflow .github/workflows/eleventy_build.yml.
name: Eleventy Build

on:
 push:
@craigerskine
craigerskine / beat-time.html
Last active May 11, 2023 12:32
Beat Time / Swatch Internet Time Using Vanilla JS
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Beat Time</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
@craigerskine
craigerskine / rutherforb-b-hayes.md
Last active October 4, 2022 14:20
Report on Rutherford B. Hayes

Rutherford B. Hayes was born humbly to his own son RBH Jr. in Delaware, while it was still Ohio, sometime after the French Revolution.

Rejecting a career as a professional speller, he was admitted to the bar in 1845 though he did not drink lustfully from it.

Serving heroically in the Civil War, Hayes admitted later that it was in the Army where he first tasted human flesh.

In 1876 Hayes beat Bill Tilden in a 3-set quarterfinal at Flushing Meadows which caused the electrical college to declare him President of the United States.

Here are a few highlight of his administration:

@craigerskine
craigerskine / twind.html
Last active August 26, 2022 19:47
Twind Starter
<!doctype html>
<html lang="en" class="motion-safe:(scroll-smooth)" hidden>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Tailwind + Twind</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.gstatic.com" rel="preconnect" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet" />
</head>
@craigerskine
craigerskine / .eleventy.js
Created August 26, 2022 15:38
11ty - Markdown Paired Shortcode (for use in templates OTHER than .md)
// let's prep for the markdown stuff, add this to the top of your config
// we are using a plugin here, so markdown can be a truly worthy option
// don't forget to `npm markdown-it-attrs --save` into your project
const markdownIt = require("markdown-it");
const markdownItAttrs = require("markdown-it-attrs");
module.exports = function(eleventyConfig) {
// somewhere in your config block, add this stuff
// you can remove the `.disable('code')` part if you want
@craigerskine
craigerskine / twind-vue.html
Last active August 5, 2022 16:36
Twind + Vue
<!doctype html>
<html lang="en" class="selection:(bg-gray-500 text-gray-50) motion-safe:(scroll-smooth)" hidden>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.gstatic.com" rel="preconnect" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet" />
</head>
@craigerskine
craigerskine / prose-alt.html
Last active June 10, 2022 16:36
twind prose
<!doctype html>
<html lang="en" class="bg-gray-200 motion-safe:scroll-smooth" hidden>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.gstatic.com" rel="preconnect" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;400;600;700;900&display=swap" rel="stylesheet" />
</head>