Skip to content

Instantly share code, notes, and snippets.

View johnfmorton's full-sized avatar
⌨️
Making stuff

John F Morton johnfmorton

⌨️
Making stuff
View GitHub Profile
@wsydney76
wsydney76 / CollapseSidebarAsset.php
Last active February 29, 2024 19:28
Make sections of Craft 5 element indexes collapsible
<?php
namespace modules\main\web\assets\collapsesidebar;
use craft\web\AssetBundle;
/**
* Collapse Sidebar asset bundle
* Experimental!
*
@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;
@Andy-set-studio
Andy-set-studio / style.css
Created January 27, 2020 17:07
Select SVG images
img[src*='.svg'] {
min-width: 100%;
}
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@jonsugar
jonsugar / show-tailwind-breakpoint.html
Last active April 19, 2024 17:31
Show current tailwind breakpoint.
<div class="flex items-center m-2 fixed bottom-0 right-0 border border-gray-400 rounded p-2 bg-gray-300 text-pink-600 text-sm">
<svg class="h-6 w-auto inline" viewBox="0 0 80 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="url(#paint0_linear)" fill-rule="evenodd" clip-rule="evenodd" d="M32 16C24.8 16 20.3 19.6 18.5 26.8C21.2 23.2 24.35 21.85 27.95 22.75C30.004 23.2635 31.4721 24.7536 33.0971 26.4031C35.7443 29.0901 38.8081 32.2 45.5 32.2C52.7 32.2 57.2 28.6 59 21.4C56.3 25 53.15 26.35 49.55 25.45C47.496 24.9365 46.0279 23.4464 44.4029 21.7969C41.7557 19.1099 38.6919 16 32 16ZM18.5 32.2C11.3 32.2 6.8 35.8 5 43C7.7 39.4 10.85 38.05 14.45 38.95C16.504 39.4635 17.9721 40.9536 19.5971 42.6031C22.2443 45.2901 25.3081 48.4 32 48.4C39.2 48.4 43.7 44.8 45.5 37.6C42.8 41.2 39.65 42.55 36.05 41.65C33.996 41.1365 32.5279 39.6464 30.9029 37.9969C28.2557 35.3099 25.1919 32.2 18.5 32.2Z"></path>
<defs>
<linearGradient id="paint0_linear" x1="3.5" y1="16" x2="59" y2="48" gradien
@dsculptor
dsculptor / transmit-iterm-patch.applescript
Last active September 1, 2021 08:33 — forked from johnfmorton/TransmitOpenTerminal.txt
Use Transmit 5 to open in iTerm (instead of Terminal.app). Ref: https://library.panic.com/transmit5/open-in-terminal/
-- Run the following cmd to make Transmit marry iterm2 as its Terminal partner:
-- defaults write com.panic.Transmit OpenTerminalScriptPath ~/transmit-iterm-patch.applescript
on openTerminal(location, remoteHost, serverPort)
-- Prepare sshCmd and cmd:
set sshCmd to ""
set cmd to "cd \"" & location & "\""
if ((count of remoteHost) is greater than 0) then
set sshCmd to "ssh " & remoteHost
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
I have the following in my .htaccess file
```
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
# ------------------------------------------------------------------------------
# | Redirect to top level /index.php to the root (www) |
@dgrigg
dgrigg / webpack.config.js
Created May 30, 2019 18:19
Webpack + Twig setup
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const TailwindCss = require('tailwindcss');
const AutoPrefixer = require('autoprefixer');
const path = require('path');
@jakedohm
jakedohm / Example.vue
Last active May 15, 2019 11:51
Vue Component to Dim Screen
<template>
<!-- Example Usage -->
<div class="menu">
<ScreenDimmer :visible="menuOpen" />
</div>
</template>
<script>
export default {
data() {