Skip to content

Instantly share code, notes, and snippets.

View shrinkray's full-sized avatar
:octocat:
Focusing

Greg Miller shrinkray

:octocat:
Focusing
View GitHub Profile
@shrinkray
shrinkray / display-if-production.php
Created June 27, 2019 23:04
Given production URL, display code otherwise don't.
<?php
/**
* Comparison adds script if site URL is same as production URL
*
* @returns inline script
*/
$site_url = get_site_url();
$prod_url = 'add-prod-url.com';
@shrinkray
shrinkray / index.html
Created April 26, 2019 20:03
Soss Door Height
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300" xml:space="preserve">
<defs>
<mask id="bottomMask">
<rect id="bbox" x="110" y="240" width="100" height="60" fill="000" />
</mask>
</defs>
@shrinkray
shrinkray / index.html
Created April 26, 2019 19:58
Soss Door Width
<div class="row clearfix">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="300px" viewBox="0 0 300 300" xml:space="preserve">
<defs>
<mask id="Mask">
<rect x="0" y="35" width="100" height="60" fill="fff" />
</mask>
<clipPath id="myClipPath" >
<rect x="0" y="35" width="200" height="60" fill="fff" >
@shrinkray
shrinkray / index.html
Created April 26, 2019 19:57
Soss Door Weight
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="300px" height="300px" viewBox="0 0 300 300" xml:space="preserve">
<!-- SCALE COMPONENTS -->
<g id="Scale">
<path id="container" fill-rule="evenodd" clip-rule="evenodd" fill="#A8A8A8" stroke="#000000" stroke-miterlimit="10" d="M202.24,289.69
l-107-0.609v-19.516l13.472-22.365c0,0,1.945-5.604,8.444-6.119c10.067-0.8,55.785-0.106,61.667-0.106s8.334,5.529,8.334,5.529
l15.083,22.741V289.69z" />
@shrinkray
shrinkray / index.html
Last active April 26, 2019 21:02
Soss Door Depth
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="300px" height="300px" viewBox="0 0 300 300" xml:space="preserve">
<defs>
<!-- For area between arrows -->
<clipPath id="myClipPath">
<rect x="180" y="100" width="20" height="30" fill="fff">
@shrinkray
shrinkray / .bash_profile
Created January 16, 2019 15:06
Admittedly, this script has been added to, but not often edited. There are possibly a few things in here worth commenting out or removing altogether.
# source ~/.profile
# Set PATH vars
export PATH="/usr/local/bin:$PATH"
export PATH=/usr/local/bin:$PATH
export PATH=$HOME/.rbenv/bin:$PATH
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
export PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:$PATH"
@shrinkray
shrinkray / wp-custom-login.php
Created September 23, 2017 23:49
Added to functions.php to replace WordPress Logo with other branding for sites.
<?php
/**
* Customized Login Actions
*
*/
function loginlogo() { // TODO use brand colors if possible
echo "<style type=\"text/css\">
.login h1 a {
@shrinkray
shrinkray / wp-custom-login.php
Last active December 22, 2019 02:38
Replace WordPress Login & Logo with other branding for sites.
<?php
/**
* Customized Login Actions
*
*/
function loginlogo() { // TODO use brand colors if possible
echo "<style type=\"text/css\">
.login h1 a {
@shrinkray
shrinkray / acf-snippets.php
Last active September 28, 2016 14:26
This will be a collection of snippets I use all the time in WP template pages.
<!-- Header -->
<!-- True/False -->
<!-- Images -->
<?php // vars
$pic = wp_get_attachment_image(get_sub_field( 'image' ), 'full', false, $attr=array('class' => 'img-responsive'));
?>
<?php echo $pic; ?>
@shrinkray
shrinkray / WordPress htaccess on Apache
Last active August 26, 2022 09:42
HTACCESS & Apache, Improve grade on GTMetrix without the help of plugins.
# BEGIN KEEP ALIVE
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
# END KEEP ALIVE
# BEGIN EXPIRES
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On