Skip to content

Instantly share code, notes, and snippets.

View GarySwift's full-sized avatar

Gary Swift GarySwift

  • Waterford City, Ireland
View GitHub Profile
@GarySwift
GarySwift / header-solid-background-line-behind.scss
Created March 8, 2017 13:12
Solid Header with Horizontal Type Line Behind Text
/**
* Horizontal Type Line Behind Text
* Inspired by this discussion @ CSS-Tricks: http://css-tricks.com/forums/topic/css-trick-for-a-horizontal-type-line-behind-text/#post-151970
* Available on jsFiddle: http://jsfiddle.net/ericrasch/jAXXA/
* Available on Dabblet: http://dabblet.com/gist/2045198
* Available on GitHub Gist: https://gist.github.com/2045198
*/
$sans-serif: Sans-Serif;
.header-solid-background {
@GarySwift
GarySwift / wp-config.php
Last active March 28, 2017 10:16
WordPress Debug mode for developing
<?php
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
@GarySwift
GarySwift / _slug-text.php
Created March 28, 2017 18:32
Change string into lowercase slug
<?php
/**
* Change string into lowercase slug
*
* @param $string Any string
* @return $string Converted string into slug
*/
function slug($string) {
# Lower case everything
$string = strtolower($string);
@GarySwift
GarySwift / _navigation-desktop-center.php
Created March 28, 2017 18:49
FoundationPress: Desktop Center Navigation Addon
<?php
/**
* FoundationPress: Desktop Center Navigation Addon
*
* A modifcation to the WordPress starter theme FoundationPress created by olefredrik based on Zurb Foundation.
*
* @link http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
* @package FoundationPress
* @ref https://github.com/olefredrik/FoundationPress
*/
@GarySwift
GarySwift / _colors.scss
Created April 1, 2017 09:24
Sass Nested Color Palette: An example of how to how to use nested color palettes in sass.
// Color Palettes
$kilflam-colors: (
'primary': #E10001,
'secondary': #FE9800
);
$guardian-colors: (
'primary': #004A9D,
'secondary': #0099F2
);
$fumeguard-colors: (
@GarySwift
GarySwift / header.scss
Created April 5, 2017 13:01
SASS: Target All H Tags in Loop
@for $index from 1 through 6 {
h#{$index}{
margin: 0;
}
}
@GarySwift
GarySwift / flexbox.css
Created March 29, 2017 13:42
CSS Vertical Center with Flexbox
/* Ref: https://davidwalsh.name/css-vertical-center-flexbox */
/*
Vertical centering requires a parent and children elements but
only the parent element needs CSS properties set for the vertical
centering of child elements:
*/
.flexbox-container {
display: -ms-flexbox;
display: -webkit-flex;
@GarySwift
GarySwift / 0_reuse_code.js
Created April 27, 2017 08:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@GarySwift
GarySwift / Change_Default_WordPress_Uploads_Folder.md
Last active April 27, 2017 08:42
WordPress: Change the Default WordPress Uploads Folder (to assets)

Change the Default WordPress Uploads Folder

Open your wp-config.php file, located at the root of your WordPress installation, and add the snippet below.

Make sure you add this code after the line:

'/* That's all, stop editing! Happy blogging. */'

Make sure you add this code before the line:

@GarySwift
GarySwift / _magnific-popup-event-listener.js
Created May 4, 2017 09:04
Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for user with any device.
/** ref: http://dimsemenov.com/plugins/magnific-popup/ */
jQuery(document).ready(function ($) {
var small='';
if (typeof site !== 'undefined') {
small = '<small>'+site.name+' - '+site.description+'</small>';
}
$('.lightbox-gallery').each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: 'a.lightbox', // the selector for gallery item
type: 'image',