View debug_log.php
/** | |
* Writes a formatted line to the current environment's error log. | |
* | |
* @param mixed... $items_to_log One or more items to output to the log. | |
* | |
* @since 2020.2.0 | |
* @author Nick Brombal <nick.brombal@publicishawkeye.com> | |
*/ | |
function debug_log(...$items_to_log): void | |
{ |
View css-selector-regex.php
<?php | |
/** | |
* Creates a regular expression string for properly capturing a specific CSS | |
* selector within a stylesheet. This regular expression ensures that the | |
* captured selector isn't actually a substring of another selector. | |
* | |
* As always, regular expressions should be considered a last resort for most | |
* string manipulation due to their high probablity of human error. Think hard | |
* about whether or not this solution is truly the last or best one available to |
View .gitconfig
[alias] | |
st = status | |
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' | |
# I use tug and weld to simplify my branch management. I often want to | |
# keep a branch distinct even when it could be fast-forwarded, so weld | |
# saves me a second there. I use tug to update a branch without | |
# automatically initiating a merge when I don't mean to. | |
tug = pull --ff-only |
View countdown.js
$(function() { | |
// If target date is specific to one timezone, set to true and specify it | |
var absoluteTarget = true; | |
var targetTimeZone = -5; | |
var targetDateUTC = new Date(Date.UTC(2015,05,22)).getTime(); | |
var currentDate = new Date(); | |
var timeZoneOffset = (absoluteTarget ? targetTimeZone * -60 : currentDate.getTimezoneOffset()) * 60 * 1000; | |
var targetDate = targetDateUTC + timeZoneOffset; |