Skip to content

Instantly share code, notes, and snippets.

View sean-gilmore's full-sized avatar
🥦

Sean sean-gilmore

🥦
View GitHub Profile
@sean-gilmore
sean-gilmore / htaccess gzip and browser caching
Last active August 29, 2018 03:32
htaccess gzip and browser caching
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@sean-gilmore
sean-gilmore / simple-wordpress-breadcrumb.php
Created May 28, 2017 11:50
Paste this inside the functions.php file, call on page, pass in page id
<?php
function the_breadcrumb($id) {
$result= "";
if($id == 0) {
echo '<a href="' . get_permalink(get_option( 'page_on_front' )) . '">Home</a>';
} else if (get_post_type($id) == "team") {
$parent = get_page_by_title("Meet Our Team")->ID;
$result.= the_breadcrumb($parent);
echo '<a href="' . get_permalink($id) . '">' . get_the_title($id) . '</a>';
} else {
{
"Version": "2008-10-17",
"Statement": [{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": { "AWS": "*" },
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::bucket-name/*" ]
}]
}
@sean-gilmore
sean-gilmore / wp-config.php
Created January 30, 2018 00:07
Fix Question mark characters appearing in text
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
@sean-gilmore
sean-gilmore / extensions.md
Created July 30, 2018 07:06
Sean's recommended vscode extensions

Sean's recommended vscode extensions

General

  • Bookmarks
  • Bracket Pair Colorizer
  • Advanced New File
  • Code Spell Checker
  • File Utils
  • file-icons
  • Git Blame
@sean-gilmore
sean-gilmore / wordpress.gitignore
Created December 27, 2018 03:38
Recommended WordPress .gitignore
*.log
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/mu-plugins/
wp-content/wp-cache-config.php
@sean-gilmore
sean-gilmore / breakpoints-and-z-index.scss
Last active January 20, 2021 23:42
Breakpoints and Z-Index Variables
// https://semantic-ui.com/elements/container.html - breakpoints
$extra-large-monitor-max: 1300px;
$large-monitor-min: 1200px;
$large-monitor-max: 1199px;
$small-monitor-min: 992px;
$small-monitor-max: 991px;
$tablet-min: 768px;
$tablet-max: 767px;
$mobile-min: 436px;
$mobile-max: 435px;
@sean-gilmore
sean-gilmore / froala.js
Created April 8, 2019 03:54
Froala Editor Wrapper
$.FroalaEditor.DefineIcon('alert', {NAME: 'info'});
$.FroalaEditor.RegisterCommand('alert', {
title: 'Hello',
focus: false,
undo: false,
refreshAfterCallback: false,
callback: function () {
alert('Hello!');
}
});
<p class="body--lead">This is some test lead text.</p>
<hr />
<p>OK, so images can get quite complicated as we have a few variables to work with! For example the image below has had a caption entered in the WordPress image upload dialog box, this creates a [caption] shortcode which then in turn wraps the whole thing in a <code>div</code> with inline styling! Maybe one day they'll be able to use the <code>figure</code> and <code>figcaption</code> elements for all this. Additionally, images can be wrapped in links which, if you're using anything other than <code>color</code> or <code>text-decoration</code> to style your links can be problematic.</p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 510px"><a href="#"><img src="http://www.wpfill.me.s3-website-us-east-1.amazonaws.com/img/img_large.png" alt="Your Alt Tag" title="bmxisbest" width="500" height="300" class="size-large wp-image-28"></a><p class="wp-caption-text">This is the optional caption.</p></div>
<p>The next issue we face is imag
@sean-gilmore
sean-gilmore / get-query-params.js
Created May 28, 2019 03:21
Vanilla.js Query String parse
function getQueryParams() {
var qd = {};
if (location.search) {
location.search.substr(1).split("&").forEach(function(item) {
var s = item.split("="),
k = s[0],
v = s[1] && decodeURIComponent(s[1]);
(qd[k] = qd[k] || []).push(v)
})