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
# get root url | |
window.location.origin | |
Cross-browser @media (width) and @media (height) values | |
let vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) | |
let vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) | |
window.innerWidth and window.innerHeight | |
gets CSS viewport @media (width) and @media (height) which include scrollbars | |
initial-scale and zoom variations may cause mobile values to wrongly scale down to what PPK calls the visual viewport and be smaller than the @media values |
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
source: https://stackoverflow.com/questions/31968664/upgrade-all-the-casks-installed-via-homebrew-cask | |
brew upgrade --cask | |
# However this will not update casks that do not have versioning information (version :latest) or applications that have a built-in upgrade mechanism (auto_updates true). To reinstall these casks (and consequently upgrade them if upgrades are available), run the upgrade command with the --greedy flag like this: | |
brew upgrade --cask --greedy | |
# To get outdated: | |
brew outdated --cask --greedy --verbose |
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
cdp_params = { | |
origin: page.server_url, | |
permission: { name: 'clipboard-read' }, | |
setting: 'granted' | |
} | |
page.driver.browser.execute_cdp('Browser.setPermission', **cdp_params) |
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
<LoadingSpinner size={25} /> |
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
new Date().toLocaleDateString('en-us', { weekday:"long", year:"numeric", month:"short", day:"numeric"}) |
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
CommunicationPreference.where(contactable_id: c.id).destroy_all | |
# loop | |
cids = Customer.active.last(100).pluck(:id) | |
cids.select {|id| CommunicationPreference.where(contactable_id: id).destroy_all} |
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
Setting['roxy.show_redeem_gifts_banner_end_date'] = Date.new(1970, 1, 1) | |
Setting['roxy.show_redeem_gifts_banner_start_date'] = nil | |
Setting['roxy.show_holiday_banner_end_date'] = Date.new(1970, 1, 1) | |
Setting['roxy.show_holiday_banner_start_date'] = nil | |
Setting['roxy.early_clearance_promo_access_start_date'] = nil | |
Setting['roxy.early_clearance_promo_access_end_date'] = Date.new(1970, 1, 1) | |
Setting['roxy.early_demi_fine_access_start_date'] = nil | |
Setting['roxy.early_demi_fine_access_end_date'] = nil | |
Setting['roxy.holiday_filter_start_date'] = nil | |
Setting['roxy.holiday_filter_end_date'] = nil |
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
# To run a file | |
rubocop -f files -A app/helpers/application_helper.rb | |
rubocop -f files -A test/features/roxy/cart_modal_logged_out/edit_billing_info_test.rb | |
# To run a folder | |
rubocop -f files -A test/features/roxy/cart_modal_logged_out | |
# To run on change ruby files only | |
git ls-files -m | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs rubocop |
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
gem install redis -v 4.6.0 |
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
bundle config install --gemfile=Gemfile.local | |
# Adds the following to your .bundle/config | |
BUNDLE_INSTALL: "--gemfile=Gemfile.local" | |
# install debase | |
gem install debase -v0.2.5.beta2 -- --with-cflags="-Wno-incompatible-function-pointer-types" | |
NewerOlder