- Address the user as Cam.
- Optimize for correctness and long-term leverage, not agreement.
- Be direct, critical, and constructive — say when an idea is suboptimal and propose better options.
- Assume staff-level technical context unless told otherwise.
Applied rationality for a coding agent. Defensive epistemology: minimize false beliefs, catch errors early, avoid compounding mistakes.
This is correct for code, where:
- Reality has hard edges (the compiler doesn't care about your intent)
- Mistakes compound (a wrong assumption propagates through everything built on it)
- The cost of being wrong exceeds the cost of being slow
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
| addEventListener('fetch', event => { | |
| event.respondWith(purgeCache(event.request)) | |
| }) | |
| async function purgeCache(request) { | |
| const url = new URL(request.url) |
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
| 'use strict'; | |
| const moment = require('moment'); | |
| /** | |
| * Returns a {key: value} object where the key is a start date and the value is the date + 1 of the type of interval | |
| * to the start date. When for weeks or months, it shows just the first date of the week/month. | |
| * | |
| ** For days (start: '2017-12-25', end: '2018-01-02', interval: 'day'): | |
| { '2017-12-25': '2017-12-26', |
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 | |
| /** | |
| * Using WP Statuses for custom Post Types. | |
| * | |
| * @link http://github.com/imath/wp-statuses | |
| */ | |
| // Exit if accessed directly. | |
| defined( 'ABSPATH' ) || exit; |
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
| /** | |
| * Fluid typography between a min & max font-size and molten leading | |
| * calc(minSize + (maxSize - minSize) * ((100vw - minPort) / (maxPort - minPort))); | |
| */ | |
| :root { | |
| font-size: 100%; | |
| } | |
| body { | |
| font-size: 1em; |
This simple procedure will allow you to:
- Display user meta fields under in the user list as additional columns (Users > All Users).
- Display these fields on user profiles.
- Edit these fields under user edit.
This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fields completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).
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
| add_action( 'gform_after_submission', '_convert_date_to_timestamp', 10, 2 ); // Extend | |
| function _convert_date_to_timestamp( $entry, $form ) { | |
| date_default_timezone_set ( "America/Denver" ); | |
| // Make sure that we're submitting a post before running the code | |
| if ( $entry['post_id'] ){ | |
| foreach ( $entry as $key => $value ){ |
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
| function string_to_slug (str) { | |
| str = str.replace(/^\s+|\s+$/g, ''); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
| var to = "aaaaeeeeiiiioooouuuunc------"; | |
| for (var i=0, l=from.length ; i<l ; i++) { | |
| str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
| } |
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
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
NewerOlder