jQuery(function($) {
var path = window.location.href;
$('nav a').each(function() {
if (this.href === path) {
$(this).addClass('is-active');
}
});
});
/* grid 24x24 */ | |
.container { | |
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='enable-background:new 0 0 24 24' viewBox='0 0 24 24'%3E%3Cpath d='M0 5h24v1H0zM0 17h24v1H0z' style='fill:%23ddd'/%3E%3Cpath d='M5 0h1v24H5z' style='fill:%23ddd'/%3E%3Cpath d='M11 0h1v24h-1z' style='fill:%23bbb'/%3E%3Cpath d='M17 0h1v24h-1z' style='fill:%23ddd'/%3E%3Cpath d='M0 11h24v1H0z' style='fill:%23bbb'/%3E%3Cpath d='M0 23h24v1H0z' style='fill:%23999'/%3E%3Cpath d='M23 0h1v24h-1z' style='fill:%23999'/%3E%3C/svg%3E"); | |
} |
To unzip the epub, move the ePub to a folder, cd to it then simply:
unzip MyEbook.epub
E-book readers require that the mimetype file is the first one in the zip document. What's more, to be fully compliant, this file should start at a very specific point - a 30-byte offset from the beginning of the zip file (so that the mimetype text itself starts at byte 38). If this sounds intimidating, don't worry. It's actually quite easy to achieve if you're careful.
#!/usr/bin/env python3 | |
# | |
# Convert .itermcolors files to kitty terminal color settings. | |
# Modded from https://gist.github.com/MSylvia/4e90860743f1a4de187d | |
# Might need to adjust dicts[i][NUMBER].text per your file. | |
import sys | |
import xml.etree.ElementTree as ET | |
def rgb_to_hex(rgb): |
If maintenance.php
is in a folder called inc
within the WordPress theme folder, then include this code at the top of the header.php
file of the theme:
require_once get_stylesheet_directory() . '/inc/maintenance.php';
Everyone not logged in visiting the website will get the message.
git config --global credential.helper store
<?php | |
// start the output buffer | |
ob_start('compress_page'); | |
?> | |
<!-- all html content here --> | |
<?php | |
// end the buffer, echo the page content | |
ob_end_flush(); | |
// function that gets rid of tabs, line breaks, and extra spaces |
This guide is intended to assist you in maintaining an up-to-date development environment for macOS using the latest versions of Homebrew, Apache, PHP, and MariaDB.
Make a backup of your computer, but also think about exporting databases of your projects in .sql
files from PhpMyAdmin.
If you don't already have XCode installed, it's best to first install the command line tools as these will be used by homebrew:
#!/usr/bin/env bash | |
do_something() { | |
grep --help | grep '\-i' | |
grep --help | grep -e -i | |
grep --help | grep -- -i | |
} |