Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rcherny's full-sized avatar

Rob Cherny rcherny

View GitHub Profile
@rcherny
rcherny / input.scss
Created April 22, 2022 19:52
Generated by SassMeister.com.
$breakpoints: (
'mobile': 375px,
'tablet': 768px,
'desktop': 1440px
) !default;
@function getBp() {
@return $breakpoints;
@rcherny
rcherny / input.scss
Created March 2, 2022 19:11 — forked from GiselaMD/input.scss
Generated by SassMeister.com.
// This is the default html and body font-size for the base rem value.
$rem-base: 16px !default;
$base-font-family: 'din-2014', Arial, sans-serif;
$fallback-font-family: Arial, sans-serif;
// --- Colors ---
$colors: (
primary: (
enterpriseGreen: #169a5a,
@rcherny
rcherny / input.scss
Created February 24, 2022 14:58
Generated by SassMeister.com.
$breakpoints: (
mobile: 599px,
stablet: 767px,
tablet: 1023px,
desktop: 1279px,
wide: 1600px
);
@mixin breakpoint($breakpoint, $min: false) {
@if $min and map-has-key($breakpointsMin, $breakpoint) {
@media (min-width: map-get($breakpointsMin, $breakpoint)) {
@rcherny
rcherny / bookmark.js
Created March 12, 2021 15:49 — forked from clenemt/bookmark.js
AEM bookmark for quick edit/preview switch
// Drops you in preview mode
javascript:(function() {
var d = document, l = d.location, s = l.search;
d.cookie = 'wcmmode=preview; path=/';
if (l.href.includes('editor.html') || !l.href.includes('wcmmode=disabled')) {
s = s.replace(/[\?&]?wcmmode=\w*/g, '');
l.href = l.origin + l.pathname.replace(/\/editor\.html/g, '') + s + (s ? '&' : '?') + 'wcmmode=disabled';
} else {
@rcherny
rcherny / WCMMode
Created March 12, 2021 15:46 — forked from Doff3n/WCMMode
WCMMode bookmarklet toggle for AEM 6.0
javascript:(function() { document.location = (document.location.href.search(/[?&]wcmmode=disabled/) < 0 ? document.location.href + (document.location.href.indexOf('?') < 0 ? '?' : (document.location.href.search(/\?./) < 0 ? '' : '&')) + 'wcmmode=disabled' : document.location.toString().replace(/wcmmode=disabled&?/, '')).replace(/[?&]$/, '');if(window.location.href.indexOf("cf#") > -1){location.reload();}})();
// ==UserScript==
// @name StyledTags
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author You
// @match https://*.workflowy.com/*
// @icon https://www.google.com/s2/favicons?domain=workflowy.com
// @grant none
// ==/UserScript==
@rcherny
rcherny / Promise_Patterns.md
Created December 17, 2020 01:15 — forked from dannyfritz/Promise_Patterns.md
Promise Patterns for Happier Relationships 💍

Promises

new Promise()

  • new Promise((resolve, reject) => {})
const getDinosaur = (name) => {
  return new Promise((resolve, reject) => {
    resolve({name})
@rcherny
rcherny / debugger pause beforeunload
Last active March 27, 2021 14:34 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
function createPause() {
console.log('debugger breakpoint applied to beforeunload;');
@rcherny
rcherny / prettier-branch.sh
Created April 1, 2019 17:25 — forked from tlrobinson/prettier-branch.sh
Steps for merging an old branch into a newly prettier-ified codebase. Use at your own risk, verify everything was correctly merged.
# Assumes 3 sequential commits:
#
# 1. commit tagged "prettier-before" that added `prettier` depedency and `prettier` script your package.json
# 2. commit that actually ran `prettier` on your entire codebase for the first time
# 3. commit tagged "prettier-after" that fixes any minor issues caused by prettier (e.x. moving eslint-ignore or $FlowFixMe comments around), or just the next commit if there were none
#
# I recommend running these as individual commands, not as a script, in case of merge conflicts
#
# Checkout the non-pretty branch you want to merge
# (or optionally make a new branch with `git checkout -b $YOUR_BRANCH-prettier $YOUR_BRANCH`)
@rcherny
rcherny / find-defined-window-globals.js
Created March 23, 2019 13:46
Find the globals defined by the current page on window
// find the globals defined by the current page
(function(){
var iframe = document.createElement('iframe');
iframe.src = "about:blank";
document.body.appendChild(iframe);
var windowVars = Object.keys(iframe.contentWindow);
var globalVars = Object.keys(window).filter(key => !windowVars.includes(key));
console.log("global Vars:", globalVars);