Skip to content

Instantly share code, notes, and snippets.

View frank-laemmer's full-sized avatar

Frank Lämmer frank-laemmer

View GitHub Profile
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active April 26, 2024 11:06
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@kslstn
kslstn / themes.js
Last active July 2, 2023 17:04
My script to add theming support and switch between light mode and dark mode
// Find if user has set a preference and react to changes
(function initializeTheme(){
syncBetweenTabs()
listenToOSChanges()
enableTheme(
returnThemeBasedOnLocalStorage() ||
returnThemeBasedOnOS() ||
returnThemeBasedOnTime(),
false)
}())
@jonathanstanley
jonathanstanley / rsync-fortrabbit.sh
Last active July 23, 2019 20:12
Enable DELETE on fortrabbit Universal Apps
#!/bin/sh
# This script has 2 lines of fast code to resolve an issue with fortrabbit "universal" apps for PHP sites, but could be used for others.
# For background, see https://help.fortrabbit.com/git-deployment#toc-git-deployment-vs-universal-apps
# On reading that, I expected "overwrite but not delete" strategy meant files outside git would not be deleted.
# However it literally means a committed delete will not be deleted.
# In other words, if you change a file to be empty, it's nullified on push. But if you delete, nothing happens on push; could leave insecure code on your server.
# fortrabbit does not place the .gitignore but rsync requires it, so push it up
scp ~/SOURCEDIR/.gitignore FORTRABBITAPP@tunnel.us1.frbit.com:~
@nickpunt
nickpunt / lightswitch.js
Last active September 12, 2019 13:39
Lightswitch: A dark mode switcher with user override
/*******************************************************************************
LIGHTSWITCH: A DARK MODE SWITCHER WITH USER OVERRIDE
By Nick Punt 10/26/2018
How to use:
* Create two color schemes in CSS under the classes 'light' and 'dark'
* Add the class 'light' or 'dark' to your body as your default color scheme
* Add button to page with id 'lightswitch', which lets users change/override
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@daehli
daehli / VSCODE.md
Created December 18, 2017 19:51
Install Visual Studio Code on Mac OS and add vscode alias

Brew Install

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

Install Brew Visual-Studio Code

brew cask install visual-studio-code
@folbert
folbert / bedrock-setup-guide.md
Last active October 16, 2023 11:08
How to get up and running with Bedrock and Bedrock Capistrano at Oderland

Getting up and running with Bedrock

If you get totally stuck, here are some resources that may help you: Roots Discourse. Actually, you may want to head over and read this through really quick. It's nowhere near as long as this and may be good to have in the back of your mind when reading the rest of this document. Capistrano Website with manual Screencast on deploying WordPress with Capistrano.

Bedrock?

Bedrock is created by the good awesome people behind Sage and is described as a "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure." Read more at https://roots.io/bedrock.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@Phlow
Phlow / jekyll-sorted-category-for-loop-alphabetical-date.liquid
Last active March 12, 2022 14:18
Jekyll (Liquid) for loop to sort posts by category in alphabetical or date-based or similiar order.
{% comment %}
#
# Change date order by adding '| reversed'
# To sort by title or other variables use {% assign sorted_posts = category[1] | sort: 'title' %}
#
{% endcomment %}
{% assign sorted_cats = site.categories | sort %}
{% for category in sorted_cats %}
{% assign sorted_posts = category[1] | reverse %}
<h2 id="{{category[0] | uri_escape | downcase }}">{{category[0] | capitalize}}</H2>
@suvozy
suvozy / 1. Enable.md
Last active July 5, 2023 12:29
PHP Dev on Mac OS X 10.10 (PHP, MySQL, Apache, Composer)

Apache

to start it

sudo apachectl start

to stop it

sudo apachectl stop

to restart it