layout | title | permalink |
---|---|---|
checklist_page |
The Side Project Marketing Checklist |
/marketing-checklist/ |
This file contains 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 | |
/** | |
* Plugin Name: Custom Notifications | |
* Plugin URI: https://braunson.ca/?ref=wp-custom-notifications | |
* Description: This plugin provides custom notifications. | |
* Version: 1.0.0 | |
* Author: Braunson Yager | |
* Author URI: https://braunson.ca/?ref=wp-custom-notifications | |
* Requires PHP: 7.4 | |
*/ |
This file contains 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
// ==UserScript== | |
// @name JIRA Open link in new | |
// @namespace braunson.jira.open.links.in.new.tab | |
// @version 1.0.1 | |
// @description Adds target="_blank" to any links within a card's text description | |
// @supportURL https://gist.github.com/Braunson/1286ea8ff8eda73b66164184926fe980 | |
// @author Braunson Yager (geekybeaver.ca) | |
// @match https://*.atlassian.net/* | |
// @grant none | |
// ==/UserScript== |
This file contains 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 | |
// Only when the query param is filled. Using whenFilled will check everything, not just query params | |
Request::macro('whenQueryFilled', function ($key, callable $callback, callable $default = null) { | |
if (! is_null($this->retrieveItem('query', $key, null))) { | |
return $callback(data_get($this->query(), $key)) ?: $this; | |
} | |
if ($default) { | |
return $default(); |
This file contains 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 | |
function solution($arr) | |
{ | |
// If the array is empty or there is only 1 value | |
if (count($arr) <= 1) { | |
return ''; | |
} | |
// A quick check as to not redefine the function |
This file contains 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
function list_hooks( $hook = '' ) { | |
global $wp_filter; | |
if ( isset( $wp_filter[$hook]->callbacks ) ) { | |
array_walk( $wp_filter[$hook]->callbacks, function( $callbacks, $priority ) use ( &$hooks ) { | |
foreach ( $callbacks as $id => $callback ) | |
$hooks[] = array_merge( [ 'id' => $id, 'priority' => $priority ], $callback ); | |
}); | |
} else { | |
return []; |
This file contains 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 | |
public function boot() | |
{ | |
// Extend the Query Builder | |
\lluminate\Database\Query\Builder::macro('whereBetweenDates', function($firstColumn, $secondColumn, $firstDate, $secondDate, $firstComparison = '>=', $secondComparison = '<=') { | |
return $this | |
->whereDate($firstColumn, $firstComparison, $firstDate) | |
->whereDate($secondColumn, $secondComparison, $secondDate); | |
}); |
This file contains 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
// Support for Query Builder | |
Illuminate\Database\Query\Builder::macro('toRawSql', function() { | |
return array_reduce($this->getBindings(), function ($sql, $binding) { | |
$binding = str_replace(['\\', "'"], ['\\\\', "\'"], $binding); | |
return preg_replace('/\?/', is_numeric($binding) | |
? $binding | |
: "'" . $binding . "'", $sql, 1); | |
}, $this->toSql()); | |
}); |
This file contains 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
$route = \Route::getRoutes()->getByName('home'); | |
// => Illuminate\Routing\Route { | |
// +uri: "/", | |
// +methods: [ | |
// "GET", | |
// "HEAD", | |
// ], | |
// +action: [ | |
// "middleware" => [ |
This file contains 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
(function( $ ){ | |
jQuery.uaMatch = function( ua ) { | |
ua = ua.toLowerCase(); | |
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || | |
/(webkit)[ \/]([\w.]+)/.exec( ua ) || | |
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || | |
/(msie) ([\w.]+)/.exec( ua ) || | |
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || []; | |
return { |