Skip to content

Instantly share code, notes, and snippets.

View ashby's full-sized avatar

Ashby Utting ashby

View GitHub Profile
@ashby
ashby / CSS: Responsive Video
Last active August 29, 2015 14:03
CSS: Responsive Video
.content .video{
width:100%;
height:auto;
.video-wrapper{
clear: both;
max-width: 100%;
}
.fluid-video{
position: relative;
padding-top: 56.25%;
@ashby
ashby / CSS: WP Image Styles
Last active August 29, 2015 14:02
CSS: WP Image Styles
img.alignright {float:right; margin:0 0 1em 1em}
img.alignleft {float:left; margin:0 1em 1em 0}
img.aligncenter {display: block; margin-left: auto; margin-right: auto}
a img.alignright {float:right; margin:0 0 1em 1em}
a img.alignleft {float:left; margin:0 1em 1em 0}
a img.aligncenter {display: block; margin-left: auto; margin-right: auto}
@ashby
ashby / CSS: Placeholder
Last active August 29, 2015 14:01
CSS: Placeholder
input::-webkit-input-placeholder {
}
input:-moz-placeholder {
}
input::-moz-placeholder {
}
input:-ms-input-placeholder {
}
@ashby
ashby / HTML: Gravity Form Build
Last active August 29, 2015 14:01
HTML: Gravity Form Build
<div class="gf_browser_chrome gform_wrapper">
<form>
<div class="gform_heading">
<h3 class="gform_title"></h3>
<span class="gform_description"></span>
</div>
<div class="validation_error"></div>
<div class="gform_body">
<ul class="gform_fields top_label description_below">
<li class="gfield full-width gfield_error">
@ashby
ashby / SCSS: Breakpoint Mobile
Last active August 29, 2015 14:01
SCSS: Breakpoint Mobile
@include breakpoint(mobile) {
}
@ashby
ashby / SCSS: Breakpoint Mixin
Last active August 29, 2015 14:01
SCSS: Breakpoint Mixin
@mixin breakpoint($point) {
@if $point == mobile {
@media only screen and (max-width: 568px) { @content; }
}
}
@ashby
ashby / WP: Config Admin Menu
Last active August 29, 2015 14:01
WP: Config Admin Menu
function remove_and_add_menu_items() {
global $menu;
global $submenu;
remove_menu_page( $menu_slug );
remove_submenu_page( $menu_slug, $submenu_slug );
add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
}
@ashby
ashby / PHP: Prep ID or URL
Last active August 29, 2015 14:01
PHP: Prep ID/URL
function prepID($string) {
$string = strtolower($string);
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string);
$string = preg_replace("/[\s-]+/", " ", $string);
$string = preg_replace("/[\s_]/", "-", $string);
return $string;
}
@ashby
ashby / GIT: Reset Hard and Roll Back
Last active August 29, 2015 14:01
GIT: Reset Hard and Roll Back
git reset --hard 258ba52
git reset --soft HEAD@{1}
git commit -m "revert to commit 258ba52"
git reset --hard
git push -f
@ashby
ashby / GIT: .gitignore
Last active August 29, 2015 14:01
GIT: .gitignore
.htaccess
wp-config.php
logs/
wp-content/upgrade/
wp-content/uploads/
wp-content/debug.log
# W3 Total Cache
wp-content/cache/*
!wp-content/cache/index.html