Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Rasch ericrasch

View GitHub Profile
@ericrasch
ericrasch / WP Security README.md
Last active Feb 17, 2022
Hardening & Improving WordPress Security
View WP Security README.md
@ericrasch
ericrasch / 0_Bulletproof PHP Paths.php
Last active Aug 22, 2021
Different ways to find paths via PHP
View 0_Bulletproof PHP Paths.php
<?php
/**
* Defined paths for local/production vs. staging servers
* example: http://website.com/main-folder/sub-folder/paths.php
* $full_uri: http://website.com/main-folder/sub-folder/paths.php
*/
$full_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$path = dirname($_SERVER[PHP_SELF]);
$current_path = substr( $path, strrpos($path,'/') + 1 );
View SEO Checklist.md
@ericrasch
ericrasch / pull_request_template.md
Created May 14, 2021
Pull Request Template for GitHub
View pull_request_template.md

Resolves #

Description

Staging Links

Screenshots (if appropriate):

View index.html
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"></link>
<div class="social">
<a href="#" class="fb" title="Join us on Facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
<a href="#" class="tw" title="Join us on Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="#" class="insta" title="Join us on Instagram"><i class="fa fa-instagram" aria-hidden="true"></i></a>
<a href="#" class="in" title="Join us on Linked In"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
</div>
View index.html
<div class="container">
<div class="card">
<div class="image">
<img src="http://res.cloudinary.com/dzuf4ztit/image/upload/c_fill,f_auto,g_center,q_auto:good,r_0,w_350/samples/landscapes/nature-mountains.jpg">
</div>
<div class="content">
<div>AMAZING WILDERNESS VIEWS • 350 ACRES</div>
<div class="price">$750,000</div>
<div class="address">101 Greenfield Drive</div>
</div>
@ericrasch
ericrasch / index.html
Created Jul 22, 2020
position: sticky
View index.html
<div class="content">
<h1>So <code>position: sticky</code> is a thing now in a <em>bunch</em> of browsers.</h1>
<p><a href="https://caniuse.com/#search=position%3A%20sticky" target="_blank">https://caniuse.com/#search=position%3A%20sticky</a></p>
<p><a href="https://developers.google.com/web/updates/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit" target="_blank">https://developers.google.com/web/updates/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit</a></p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam lectus lectus, adipiscing molestie accumsan ut, facilisis at massa. Praesent ut dictum massa. Sed vel nunc nec augue vestibulum consectetur ac mattis elit. Proin euismod cursus cursus. Sed ut aliquet lectus. Fusce pellentesque pretium massa, ut gravida elit sagittis sit amet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris at augue justo. In mollis hendrerit eleifend. Aenean ultricies au
View all-form-elements.markdown
@ericrasch
ericrasch / full-viewport-width-image-container-inside-article.markdown
Created Jul 22, 2020
full viewport width image (container) inside article
View full-viewport-width-image-container-inside-article.markdown

full viewport width image (container) inside article

elements like images (or containers) break out from inside a wrapper to full viewport width

A Pen by HigherEducation.com on CodePen.

License.

View .00 Solid Base .htaccess.md

Solid Base .htaccess

Creating a solid base for your .htaccess file. Currently includes RewriteBase, Security (against indexes, files, etc.), and Expires Headers (caching, performance).

  • The URL REWRITES would go at the top of the file.
  • The SECURITY and the WEB PERFORMANCE can go towards the bottom... before and WordPress or WP Super Cache items.
  • UPDATE 2013-08-21: Added code for forcing either non-www or www. on URLs. Also added the MultiViews option.
  • UPDATE 2013-08-23: Added specific code for wp-config.php
  • UPDATE 2013-10-04: Increased favicon expire time.
  • UPDATE 2014-02-05: Removed the Force URL rewrites since there's more than one option.