Skip to content

Instantly share code, notes, and snippets.

@siebird
siebird / ddev-bookmarklet.js
Last active September 14, 2023 15:27
Bookmarklet to convert current url to a DDEV url
/*
A bookmarket to convert a live URL to a DDEV URL. To install bookmarklet:
- right click in bookmark bar or go to bookmark manager to add new page in your browser
- click `add page`
- name 'DDEV URL` or whatever you want
- copy and paste the code below into the URL field. Lines 9-16.
*/
javascript:(function(){
const url = window.location.href;
@jeremyfrank
jeremyfrank / typography.js
Created February 2, 2023 19:33
Fluid Typography Tailwind Plugin
const plugin = require('tailwindcss/plugin')
const isPlainObject = require('tailwindcss/lib/util/isPlainObject').default
const { rem } = require('@viget/tailwindcss-plugins/utilities/fns')
/**
* Outputs various typography styles as Tailwind components
*
* .heading-NAME-SIZE
* .body-text-SIZE
* .ui-text-SIZE
@robweychert
robweychert / typographic-scale-generator.md
Last active October 26, 2021 13:21
Sass typographic scale generator

Sass typographic scale generator

Generate a typographic scale of CSS variables with any interval (fixed or proportional) and any number of sizes. Just edit $interval, $body-text, $scale-min, and $scale-max:

:root {
  $interval: 1.5;    // Unitless for proportional, unit for fixed
  $body-text: 1rem;  // Must have a unit
  $scale-min: -2;    // Unitless negative integer
  $scale-max: 2;     // Unitless positive integer
#!/usr/bin/env bash
# Via https://medium.com/@sean.handley/how-to-set-up-docker-for-mac-with-native-nfs-145151458adc
OS=`uname -s`
if [ $OS != "Darwin" ]; then
echo "This script is OSX-only. Please do not run it on any other Unix."
exit 1
fi
@ww9
ww9 / gist_markdown_examples.md
Last active May 3, 2024 10:34
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@RichardBray
RichardBray / gulp-to-webpack.md
Last active November 3, 2022 18:51
Moving from Gulp to Webpack

Moving from Gulp to webpack

I've been avoiding learning Webpack for a while now as I never thought I needed to learn another build tool, Gulp does everything I'd ever need from a build tool now or in the future. However, ever since we've moved from AngularJS to Angular (or Angular 2+) as well as introducing standards such as; TypeScript instead of Javascript and a Jasmine/Karma combo for UI testing, but also Webpack as an initial build tool. I've avoided it for long enough and now, in September 2017, I thought it's time to finally move on from my old friend Gulp.

Good Old Gulpfile

If you've never heard of Gulp before, this isn't the post to learn, there are plenty of good tutorials out there a Google search away. Then again, you don't really need to know Gulp to understand what's going on so feel free to continue reading nevertheless.

[Here's wh

@allmarkedup
allmarkedup / FractalPlugin.php
Last active August 26, 2021 15:10
Fractal component loader plugin for Craft cms
<?php
namespace Craft;
class FractalPlugin extends BasePlugin
{
public function init()
{
craft()->templates->getTwig()->setLoader(new FractalTemplateLoader());
@lifewinning
lifewinning / arendtquotes.md
Created January 30, 2017 23:54
Passages from Arednt's Origins of Totalitarianism, with page numbers.

From the Harvest Books paperback edition

"The supranationalism of the antisemites approached the question of international organization from eactly the opposite point of view. Their Aim was a dominating superstructure which would destroy all home-grown nationalist structures alike. They could indulge in hypernationalistic talk even as they prepared to destroy the body politic of their own nation, because tribal nationalism, with its immoderate lust for conquest, was one of the principal powers by which to force open the narrow and moset limits of the nation-state and its sovereignty." (41)

"Only two decades separated the temporary decline of the antisemitic movements from the outbreak of the first World War. This period has been adequately described as a 'Golden Age of Security' because only a few who lived in it felt the inherent weakness of an obviously outmoded political structure which, despite all prophecies of imminent doom,

untrailingSlashIt(str) {
return str.replace(/\/$/, '');
}
trailingSlashIt(str) {
return untrailingSlashIt(str) + '/';
}
@maxfenton
maxfenton / books.md
Last active April 24, 2024 22:23
Books I finished reading

Books I finished reading

in 2024

  • Kitchen Confidential (Audiobook) - Anthony Bourdain
  • Kitchen Confidential (Audiobook) - Anthony Bourdain
  • The Hulk: Grand Design - Jim Rugg

in 2023

  • The Human Target - Tom King, Greg Smallwood
  • Ways of Being (Audiobook) - James Bridle