Skip to content

Instantly share code, notes, and snippets.

View Vitzkrieg's full-sized avatar

Dustin Vietzke Vitzkrieg

View GitHub Profile
@Vitzkrieg
Vitzkrieg / gist:b008f34ef86d946848869c3a316b429b
Created October 30, 2023 17:51
Get Element's Before Content
const el = document.getElementById('id');
const beforeText = getComputedStyle(el, ':before').getPropertyValue('content');
@Vitzkrieg
Vitzkrieg / wp-option-name-to-title-case.php
Last active October 10, 2023 11:51
WordPress Option Name to Title Case
// convert wp_option_name -> Wp Option Name
$titlecase = ucwords( implode(' ', explode('_', $option->option_name) ) );
@Vitzkrieg
Vitzkrieg / WP-HTML-Compression
Last active September 5, 2023 14:19 — forked from sethbergman/WP-HTML-Compression
Minify HTML for WordPress without a Plugin - Add to function.php
<?php
/**
* Class to minify HTML
*
* @link https://gist.github.com/sethbergman/d07e879200bef6862131
*/
class WP_HTML_Compression
{
// Settings
<?php
add_action('get_header', 'pt_html_minify_start');
function pt_html_minify_start() {
ob_start( 'pt_html_minyfy_finish' );
}
function pt_html_minyfy_finish( $html ) {
$html = preg_replace('/<!--(?!s*(?:[if [^]]+]|!|>))(?:(?!-->).)*-->/s', '', $html);
$html = preg_replace('/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/m', "$1", $html);
$html = preg_replace('/^\/\/[^\n\r]+(?:[\n\r]|\*\))$/m', "$1", $html);
@Vitzkrieg
Vitzkrieg / externallinktargetstoblank.js
Last active August 29, 2015 14:12
Set External Link Targets to Blank
function externalLinksTargetBlank() {
jQuery('a:not([href*="' + document.location.hostname + '"])').attr('target', '_blank');
}
function lastElementLoaded() {
if (jQuery('.lastelement').length > 0) {
externalLinksTargetBlank();
} else {
setTimeout(tweetsLoaded, 500);
}

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.