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
// via https://davidwalsh.name/detect-caps-lock | |
document.querySelector('input[type=password]').addEventListener('keyup', function (keyboardEvent) { | |
const capsLockOn = keyboardEvent.getModifierState('CapsLock'); | |
if (capsLockOn) { | |
// Warn the user that their caps lock is on? | |
} | |
}); |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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 | |
// Administrator | |
current_user_can('manage_options') | |
// Editor or higher | |
current_user_can('edit_others_posts') | |
// Author or higher | |
current_user_can('publish_posts') |
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
tell application "System Events" | |
set frontmostApplication to name of the first process whose frontmost is true | |
end tell | |
-- The bounds are the top-left and bottom-right coordinates on your screen, eg. {x, y, x, y} | |
tell application frontmostApplication | |
set bounds of the first window to {15, 38, 1760, 995} | |
end tell |
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
header.fl-builder-content { | |
position:relative; | |
} | |
header.fl-builder-content:before { | |
content: ""; | |
background: rgba(255,255,255,0.52); | |
width: 100%; | |
height: 12px; | |
display: block; |
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_shortcode('SHORTCODE', function($atts){ | |
$defaults = array(); | |
$atts = wp_parse_args( $atts, $defaults ); | |
ob_start(); | |
// Do Stuff | |
return 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
/* Align a single column to the bottom of a row, where the row has a set height */ | |
#rowSelector .fl-row-content-wrap { | |
display: flex; | |
align-items: flex-end; | |
} |
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
let breakPoint = 768 | |
let moveThis = document.querySelector('.nodeToMove') | |
let newParent = document.querySelector('.newParentNode') | |
let origin = document.querySelector('.originalParentNode') | |
const moveTheNode = () => { | |
let viewportWidth = window.innerWidth || document.documentElement.clientWidth; | |
if (viewportWidth < breakPoint) { | |
newParent.after(moveThis) | |
} else { |
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
const https = require("https"); | |
let url = "https://domain.com/wp-cron.php?doing_wp_cron"; | |
exports.handler = function (event, context, callback) { | |
https | |
.get(url, (res) => { | |
callback(null, res.statusCode); | |
}) | |
.on("error", (e) => { | |
callback(Error(e)); |
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
.adaptive-glass { | |
--glass-lightness: 100%; | |
background: hsl(0 0% var(--glass-lightness) / 50%); | |
backdrop-filter: blur(40px); | |
@media (prefers-color-scheme: dark) { | |
--glass-lightness: 0%; | |
} | |
} |
NewerOlder