Skip to content

Instantly share code, notes, and snippets.

View directionforward's full-sized avatar

Direction Forward directionforward

View GitHub Profile
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
@directionforward
directionforward / detect-ios.js
Created January 21, 2021 11:53 — forked from codearryaas/detect-ios.js
JavaScript: How to detect if device is iOS?
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
console.log('This is a IOS device');
} else {
console.log('This is Not a IOS device');
}
@directionforward
directionforward / colliding.js
Last active January 27, 2021 01:08 — forked from jtsternberg/colliding.js
Detect if two elements are colliding/overlapping
var is_colliding = function($div1, $div2) {
// Div1 data
var d1_offset = $div1.offset();
var d1_height = $div1.outerHeight( true );
var d1_width = $div1.outerWidth( true );
var d1_distance_from_top = d1_offset.top + d1_height;
var d1_distance_from_left = d1_offset.left + d1_width;
// Div2 data
@directionforward
directionforward / recursive-chmod.md
Last active November 22, 2022 23:11 — forked from bzerangue/recursive-chmod.md
Scripts for recursively chmod directories only and recursively chmod files only

Useful commands

You may find these commands useful when adjusting file and directory permissions.

To recursively chmod directories only for single user permissions:

find /your/site/root -type d -exec chmod 755 {} \;

To recursively chmod directories only for group users permissions: