Skip to content

Instantly share code, notes, and snippets.

View monooso's full-sized avatar

Stephen Lewis monooso

View GitHub Profile
@monooso
monooso / machine.js
Created April 30, 2020 15:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@monooso
monooso / full.js
Last active October 16, 2017 21:49
Bookmarklet to Toggle Laravel Debugbar
javascript: (function () {
const selector = 'body > div[class~=phpdebugbar]';
document.querySelectorAll(selector).forEach(function (element) {
const styles = element.getAttribute('style');
const isHidden = styles ? (styles.trim().indexOf('display: none;') >= 0) : false;
element.style.display = isHidden ? 'block' : 'none';
});
})();
@monooso
monooso / IsPackageLoadedByPlugin
Created July 17, 2015 21:39
Helper method to determine whether a third-party Composer package is loaded by a particular Craft plugin.
/**
* Returns a boolean indicating whether the specified class is loaded from
* the directory of the specified plugin.
*
* @param $namespacedClass
* @param $pluginHandle
*
* @return bool
*/
protected function isPackageLoadedByPlugin($namespacedClass, $pluginHandle)
@monooso
monooso / Contract Killer 3.md
Last active September 28, 2024 14:11
Forked from the original Contract Killer by [Stuff & Nonsense](http://stuffandnonsense.co.uk/projects/contract-killer).

Terms and Conditions of Business

Between us {company_name}, and you {client_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 is expected, 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. We want what’s best for both parties, now and in the future.

So in short: