Skip to content

Instantly share code, notes, and snippets.

@michaelcarwile
michaelcarwile / bash-prompt
Created March 7, 2014 20:34
Full path display in bash prompt
Somewhere in your .bashrc put this
# Sets command line prompt PS1
if [ -f ~/.ps1 ]; then
. ~/.ps1
fi
Then the .ps1 file looks like this
@michaelcarwile
michaelcarwile / functions.php
Created January 20, 2014 22:15
genesis read more link with excerpts
<?php
//* Read more link
add_filter('excerpt_more', 'get_read_more_link');
add_filter('the_content_more_link', 'get_read_more_link');
function get_read_more_link() {
return '&nbsp;...<br><a href="' . get_permalink() . '">Continue Reading &rarr;</a>';
}
@michaelcarwile
michaelcarwile / responsive-navigation.css
Created January 18, 2014 23:56
responsive navigation
/* Primary Navigation Menu Icon properties */
#primary-menu-icon {
cursor: pointer;
display: block;
padding: 24px 24px;
padding: 2.4rem 2.4rem;
text-align: center;
}
@michaelcarwile
michaelcarwile / ie-inline-block-fix.css
Last active January 3, 2016 07:19
IE inline-block fix
.classname {
display: inline-block;
zoom: 1;
*display: inline;
}
@michaelcarwile
michaelcarwile / importRange_vmerge.js
Created January 6, 2014 22:36
Use VMERGE and importRange() to merge data from multiple spreadsheets in Google Drive
/* requires VMERGE Google Script to be installed */
/* Insert into formula bar where you want process to begin */
=sort(
vmerge(
importrange( "sheet_key_from_url" ; "sheet_tab_name!A2:E2000" );
importrange( "sheet_key_from_url" ; "sheet_tab_name!A2:E2000" );
)
)
@michaelcarwile
michaelcarwile / email_signup_form.html
Last active January 2, 2016 03:09
Embed a signup form to capture email address and post to Constant Contact signup form page. Designed to be used within functions.php for Genesis child theme.
<div class="email-signup">
<h4>Receive our email updates</h4>
<form id="command" action="http://visitor.r20.constantcontact.com/manage/optin/ea?v=[GRAB_FROM_SIGNUP_PAGE_PROVIDED_BY_CONSTANT_CONTACT" method="post">
<input type="hidden" name="ref" value="http://[GRAB_FROM_SIGNUP_PAGE_PROVIDED_BY_CONSTANT_CONTACT].com/"/>
<div class="row">
<input type="email" value="Email Address..." onclick="if(this.value=='Email Address...'){this.value=''}" onblur="if(this.value==''){this.value='Email Address...'}" id="emailAddr" name="emailAddr" class="email-input">
</div>
<div class="row">
<div class="privacy">
<p>Privacy Guaranteed.<br>
@michaelcarwile
michaelcarwile / clear-royalslider-cache-functions.php
Created January 1, 2014 17:32
Clear wordpress royalslider caches on post save
<?php
//* Add this code to functions.php - ignore opening php tag and this comment.
//* Clear slider caches on new post save - replace num with slider id
function rs_clear_cache() {
delete_transient( 'new-royalslider-posts-1' );
delete_transient( 'new-royalslider-posts-2' );
delete_transient( 'new-royalslider-posts-3' );
delete_transient( 'new-royalslider-posts-4' );
}
@michaelcarwile
michaelcarwile / reset royalslider id
Last active January 1, 2016 22:19
Reset royalslider id counter (in MySQL - PHPMyAdmin)
# ALTER TABLE [tablename] AUTO_INCREMENT = [number]
# for royalslider specifically:
ALTER TABLE wp_new_royalsliders AUTO_INCREMENT = [number]
@michaelcarwile
michaelcarwile / restart-apache
Created December 10, 2013 02:11
restart bitnami apache
sudo /opt/bitnami/ctlscript.sh restart apache
@michaelcarwile
michaelcarwile / li-height.js
Created November 5, 2013 20:31
Change the height of all list items in order to float properly with jQuery
//* Originally found: http://www.nikolakis.net/2011/07/change-the-height-of-all-list-items-to-float-properly-with-jquery/
/* example HTML
<ul class="list">
<li>some information</li>
<li>some more information</li>
<li>even more information</li>
</ul>
*/