Skip to content

Instantly share code, notes, and snippets.

@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());
@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

@ww9
ww9 / gist_markdown_examples.md
Last active February 1, 2026 11:06
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:
#!/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
@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
@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
@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;