Skip to content

Instantly share code, notes, and snippets.

View loughlincodes's full-sized avatar

Loughlin McSweeney loughlincodes

View GitHub Profile
@loughlincodes
loughlincodes / .htaccess
Created January 4, 2019 15:01
htaccess - www and non-www
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
@loughlincodes
loughlincodes / .htaccess
Created January 4, 2019 15:01
htaccess - Force HTTPS
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@loughlincodes
loughlincodes / .htaccess
Created January 4, 2019 15:03
ExpressionEngine 5.x htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Removes index.php from ExpressionEngine URLs
@loughlincodes
loughlincodes / mobile.css
Last active November 3, 2019 15:19
Media queries - desktop to table to mobile
/* ----------------------------------------------------------------
MOBILE styles
-----------------------------------------------------------------*/
/* Any screen at 1200px and below */
@media only screen and (max-width: 1200px) {
}
@loughlincodes
loughlincodes / gist:7ed18f4fb44ff23938a958762ddb2599
Created January 14, 2019 23:57
macOS Sierra - Show/Hide Hidden Files shortcut
Since the release of macOS Sierra, when in Finder, it is now possible to use the shortcut:
CMD + SHIFT + .
Press once to show hidden files and again to hide them.
@loughlincodes
loughlincodes / nav.html
Created January 29, 2019 14:03
Hide Nav on Scroll Down and Show on Scroll Up
<header class="nav-down">
This is your menu.
</header>
<main>
This is your body.
</main>
<footer>
This is your footer.
</footer>
@loughlincodes
loughlincodes / google-reviews.liquid
Last active March 29, 2020 14:36
Shopify Section Boilerplate (Feb2018)
<div class="google-reviews"></div>
{% schema %}
{
"name": "Google Reviews",
"class": "google-reviews",
"settings": [
],
@loughlincodes
loughlincodes / conversio-newsletter.liquid
Created April 29, 2019 07:59
Add Conversio newsletter form as a section [Shopify]
{% comment %}
** Conversio Newsletter - homepage partial **
- Draggable section
{% endcomment %}
{% assign image = section.settings.image %}
{% assign newsletter_section_text_align = section.settings.newsletter_section_text_align %}
<style>
{% assign product_tags = product.tags | join: ' ' %}
{% if product_tags contains 'whatever' %}
...do stuff...
{% endif %}
{% for block in section.blocks %}
<div class="list">
<h4>{{ linklists[block.settings.footer_menu].title }}</h4>
<ul>
{% for link in linklists[block.settings.footer_menu].links %}
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
</div> <!-- end list -->