jQuery(function($) {
var path = window.location.href;
$('nav a').each(function() {
if (this.href === path) {
$(this).addClass('is-active');
}
});
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Start output buffering and clean whitespace | |
ob_start(function ($buffer) { | |
// Remove tabs, newlines, multiple spaces between tags | |
$buffer = preg_replace('/\s+/', ' ', $buffer); | |
// Remove spaces between HTML tags | |
$buffer = preg_replace('/>\s+</', '><', $buffer); | |
return trim($buffer); | |
}); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -mindepth 1 -type f -not -name "*.*" -not -name "*\?*" -exec sh -c 'mv "{}" "{}".html' \; | |
# In this version, I've removed the -name '*.*' option, since we want to rename files that don't have a suffix. | |
# I've also replaced the -not -name '*\?' option with -not -name "*\?*", | |
# which should correctly exclude files that contain a ? character in their name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
NewerOlder