Skip to content

Instantly share code, notes, and snippets.

View dompascal's full-sized avatar

Dominic Pascal dompascal

View GitHub Profile
@dompascal
dompascal / css-animate-media-queries.css
Created February 6, 2014 20:09
CSS - Animate media queries
*{
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease;
}
@dompascal
dompascal / vim-shortcuts.txt
Created February 8, 2014 19:53
VIM - Shortcuts
i = insert at current location
a = insert after current location (append)
I = insert AT START of current line
A = insert AFTER END of current line
o = insert line below current line (open)
O = insert line ABOVE current line
s = delete character under cursor and start inserting in its place (substitute text)
S = delete all text on line and start inserting in its place (substitute line)
cw = delete to the end of current word and start inserting in its place (any movement command can be substituted for w)
cc = same as S (change line)
@dompascal
dompascal / composer-install-global.txt
Created February 15, 2014 14:42
Install - Composer gloablly on OSX.
1. Install composer in Terminal with curl -s getcomposer.org/installer | php -d detect_unicode=Off
2. Move composer to the bin directory so it can be used globally with mv composer.phar /usr/local/bin/composer
@dompascal
dompascal / wp-page-template.php
Created February 18, 2014 21:06
WP - Page template with conditional loop for the home page displaying posts assigned to the home-page category.
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the wordpress construct of pages
* and that other 'pages' on your wordpress site will use a
* different template.
*
* @package WordPress
@dompascal
dompascal / aws-s3-read-all-bucket-policy.md
Created February 26, 2014 16:45
AWS - S3 Read all bucket policy

{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPublicRead", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject",

@dompascal
dompascal / js-add-seq-number.js
Created March 11, 2014 20:17
JS - Add sequential numbers to each item
// add sequential numbers to each list item
$("ol#boutiques li .city-and-state").each(function (i) {
i = i+1;
if(i < 10) i = "0"+i;
$(this).prepend('<span class="number">' +i+ '.</span>');
});
@dompascal
dompascal / wp-acf-conditional-img.php
Created March 14, 2014 23:10
WP - ACF conditional image
<?php if(get_field('header_slideshow_image')) { ?>
<?php $image = wp_get_attachment_image_src(get_field('header_slideshow_image'), 'header-slideshow'); ?>
<img class="rsImg" src="<?php echo $image[0]; ?>" alt="" />
<?php } elseif(get_field('blog_thumbnail')) { ?>
<?php $image = wp_get_attachment_image_src(get_field('blog_thumbnail'), 'header-slideshow'); ?>
<img class="rsImg" src="<?php echo $image[0]; ?>" alt="" />
<?php } else { ?>
<img class="rsImg" src="<?php bloginfo('template_url'); ?>/css/img/slideshow-placeholder.jpg" alt="Image Unavailable" />
<?php } ?>
@dompascal
dompascal / ssh-reset-wp-permissions
Created November 23, 2013 10:54
Reset WP permissions
find -type d -exec chmod 755 {} \;
find -type f -exec chmod 644 {} \;
@dompascal
dompascal / css-shadows.css
Created November 23, 2013 10:55
CSS - Shadows
-moz-box-shadow: 0px 0px 7px #666;
-webkit-box-shadow: 0px 0px 7px #666;
box-shadow: 0px 0px 7px #666;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
@dompascal
dompascal / js-fixed-class-on-scroll.js
Created November 23, 2013 11:01
JS - Fixed Class on Scroll
// fixed nav on scroll
$(window).scroll(function(e) {
if ($(this).scrollTop() > 240 && !$('body').hasClass('fixed')) {
$('body').addClass('fixed');
}
else if ($(this).scrollTop() <= 240 && $ ('body').hasClass('fixed')) {
$('body').removeClass('fixed');
}
});