Skip to content

Instantly share code, notes, and snippets.

View corypina's full-sized avatar

Cory Piña corypina

View GitHub Profile
/* Prevent the mobile menu flyout X button from growing in font size on hover */
.fl-menu-mobile-close,
.fl-menu-mobile-close:hover {
font-size: inherit;
}
This file has been truncated, but you can view the full file.
<div class="infinite-scroll-component " style="height: auto; overflow: visible;">
<div class="Card list-card" data-testid="list-card-container">
<div class="Card__color Card__color--lg" data-testid="list-card-container--accent-color"
style="background-color: rgb(202, 160, 230);"></div>
<div class="list-card__header">
<div class="list-card__identity">
<div><span class="list-card__id">Form ID 218149</span></div>
<h3 class="list-card__name">FPFS Request Information Traditional Chinese</h3>
</div>
<div class="list-card__options">
@corypina
corypina / check-for-capslock.js
Created March 13, 2024 01:51
Detect caps lock
// 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?
}
});
// 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';
@corypina
corypina / check-role-by-capability.php
Created September 12, 2023 04:29
Check WP roles by capability
<?php
// Administrator
current_user_can('manage_options')
// Editor or higher
current_user_can('edit_others_posts')
// Author or higher
current_user_can('publish_posts')
@corypina
corypina / custom-header-shape.css
Last active March 31, 2023 19:07
Beaver Builder Snippets
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;
@corypina
corypina / align-to-bottom.css
Created December 9, 2022 22:31
Beaver Bulider Snippets
/* 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;
}
@corypina
corypina / moveElementOnWidth.js
Created November 3, 2022 00:02
Move an element from one place to another based on browser/device width
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 {
@corypina
corypina / wp-cron.js
Created September 9, 2021 16:48
Ping WordPress cron to manage cron jobs externally. For use in AWS Lambda, etc.
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));
@corypina
corypina / frosted-glass.css
Created August 9, 2021 15:50
Frosted glass effect in CSS
.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%;
}
}