Snippets frequently used with Sage
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
#!/usr/bin/env bash | |
set -euo pipefail | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cd "${DIR}" | |
REQUIRED_SYSTEM_COMMANDS=( | |
"go" | |
"octant" | |
"fswatch" |
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
type CoreArchivesBlock implements Block { | |
attributes: CoreArchivesBlockAttributes | |
name: String! | |
innerBlocks: [Block]! | |
isValid: Boolean! | |
originalContent: String! | |
parentId: Int | |
parent: PostObjectTypesUnion | |
renderedContent: String! | |
} |
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
add_action('plugins_loaded', function() { | |
$action = is_user_admin() ? 'user_admin_notices' : 'admin_notices'; | |
add_action($action, function () { | |
ob_start(); | |
}); | |
add_action('all_admin_notices', function () { | |
$log = strip_tags(trim(ob_get_clean())); |
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
/** | |
* WordPress Blocks | |
* | |
* Default block styling included with WordPress core. | |
* Provides a better starting point for WordPress theme developers, | |
* especially when using Sass. | |
* | |
* @link https://github.com/WordPress/WordPress/blob/master/wp-includes/css/dist/block-library/style.css | |
* | |
* Most styles from the above file are included. |
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
// This will open up a prompt for text to send to a console session on digital ocean | |
// Useful for long passwords | |
(function () { | |
window.sendString = function (str) { | |
f(str.split("")); | |
function f(t) { | |
var character = t.shift(); | |
var i=[]; | |
var code = character.charCodeAt(); | |
var needs_shift = character.match(/[a-z!@#$%^&*()_+{}:\"<>?~|]/); |
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 | |
// IMPORTANT UPDATE 20190307: | |
// Since WordPress 5.0.0 we can actually use much simpler solution: | |
/** | |
* Applies wrapper div around aligned blocks. | |
* | |
* Copy this function into your WordPress theme's `functions.php` file | |
* and change the `themeprefix` accordingly. |
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
h scroll left | |
j scroll down | |
k scroll up | |
l scroll right | |
gg scroll to top of the page | |
G scroll to bottom of the page | |
f activate link hints mode to open in current tab | |
F activate link hints mode to open in new tab | |
r reload |
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
<table style="font-size: 14px; text-align: left; margin: 3em 0; color: black; border: none;" border="0" cellpadding="0" cellspacing="0"><tr><td rowspan="3" valign="middle" style="vertical-align: middle;"><a href="https://system76.com" style="text-decoration: none; margin-right: 1em;"><img src="https://system76.com/images/icon-64.png" height="64" width="64" alt="System76 |" /></a></td><td style="font-family: 'Roboto Slab', serif; font-size: 24px; font-weight: 300;">Ryan Sipes</td></tr><tr><td style="font-family: 'Fira Sans', sans-serif;"><strong>COMMUNITY MANAGER</strong></td></tr><tr><td style="font-family: 'Fira Sans', sans-serif; font-weight: 300;"><a href="mailto:[email protected]" style="color: black; text-decoration: none;">[email protected]</a></td></tr> | |
</table> |
NewerOlder