Skip to content

Instantly share code, notes, and snippets.

View Fredegaard's full-sized avatar

Christian Fredegaard Fredegaard

View GitHub Profile
@AkdM
AkdM / .gitignore
Last active July 20, 2024 21:37
Daily backup Home Assistant configuration into a git repository
# You can whitelist files/folders with !, those will not be ignored.
# Everything that starts with a / are for root elements
# ignore
/custom_components/
/zigbee2mqtt/log
/zigbee2mqtt/state.json
/home-assistant_v2.* # Exclude Home Assistant history-related database. Make sure to enable git LFS if you don't exclude that, since those files can go easily over 100MB
/home-assistant.log*
/.ssh/
@samselikoff
samselikoff / tailwind.config.js
Created April 16, 2021 15:57
Firefox plugin for Tailwind CSS. Add styles that target Firefox browser only.
const plugin = require("tailwindcss/plugin");
module.exports = {
mode: "jit",
purge: {
content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"],
},
theme: { extend: {} },
variants: {},
plugins: [
@reinink
reinink / query.sql
Last active November 14, 2023 11:08
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active March 26, 2023 13:42
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@mysiar
mysiar / ideolog-monolog.md
Created February 22, 2019 18:15
Monolog template for Ideolog
Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
@argentinaluiz
argentinaluiz / command
Created November 12, 2018 16:25
cmder no PHPStorm, Pycharm, etc
"cmd.exe" /k set CMDER_ROOT=C:\cmder&&set ConEmuDir=%CMDER_ROOT%\vendor\conemu-maximus5&&call "%CMDER_ROOT%\vendor\init.bat"
@danhunsaker
danhunsaker / README.md
Last active December 15, 2019 23:38 — forked from sanderson/Environment Variables
Configuring Nanobox to Use nullmailer

nullmailer and Nanobox

Start by adding the environment variables (below) to your app, and merging the boxfile.yml entries into your own boxfile.yml. The script, here, is pulled in automatically by the git.io shortlink in the transform hook, so you don't need to add that.

Environment Variables

The values of the various evars should be provided by your SMTP service

@troyfontaine
troyfontaine / 1-setup.md
Last active July 21, 2024 20:28
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@jaw-sh
jaw-sh / cloudflare.sh
Last active October 17, 2020 08:29
Bash file to pull Cloudflare IPs from their API endpoints. Can be used in CRON jobs.
#!/bin/bash
# Author: Joshua Moon <josh@jaw.sh>
# Date: 14-May-2016
# Purpose: Creates an up-to-date Cloudflare nginx config file.
# License: MIT
################################################################################
# INSTRUCTIONS
@donniebrandt
donniebrandt / timezones.sql
Last active November 2, 2018 23:32
MySQL: Timezones.
CREATE TABLE `options` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`group` enum('Timezones') COLLATE utf8_unicode_ci NOT NULL,
`order` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`name`,`group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `options` (`name`, `group`, `order`)
VALUES
("Africa/Abidjan", 'Timezones', 0),