Skip to content

Instantly share code, notes, and snippets.

Justin Scarpetti doitlikejustin

Block or report user

Report or block doitlikejustin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
doitlikejustin /
Created Aug 16, 2013 — forked from lajlev/
How to create a bookmarklet to compose funktion in gmail.
  • Create a bookmark to Gmail.
  • Edit & paste following snippet into the url field.
javascript:var w=window,u='',l=document.location;try{ throw(0); } catch(z) {a =function(){if(!,'t','toolbar=0,resizable=0,status=1,width=600,height=500'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}void(0)
  • Boom you got a bookmarklet which make you able to compose an email, without having to enter you bloated inbox :)
doitlikejustin /
Created Aug 16, 2013
Monitor mail in Plesk
tail -F /usr/local/psa/var/log/maillog
doitlikejustin / browser_caching.htaccess
Created Aug 4, 2013
Browser caching using Expires headers in .htaccess
View browser_caching.htaccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
doitlikejustin / gzip.htaccess
Created Aug 4, 2013
gzip compression in .htaccess
View gzip.htaccess
<IfModule mod_deflate.c>
# Insert filters
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
View jquery_ready.js
$(document).ready(function() {
// Handler for .ready() called.
doitlikejustin / sitemap_shortcode.php
Created Aug 4, 2013
WordPress sitemap shortcode
View sitemap_shortcode.php
// add in functions.php
// [sitemap]
function sitemap_func( $atts ){
return wp_list_pages('title_li=&echo=0');
add_shortcode( 'sitemap', 'sitemap_func' );
View url_shortcode.php
// add in functions.php
// [url]
function sc_url($atts) {
return get_bloginfo('url');
add_shortcode('url', 'sc_url');
doitlikejustin /
Created Aug 4, 2013
Fix Duplicate or Old Items on "Open With..." List in Mac OS X
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user
doitlikejustin / email_shortcode.php
Created Aug 4, 2013
WordPress email shortcode with encoding
View email_shortcode.php
// add in functions.php
// [email]
function sc_email($atts) {
return "<a href='mailto:$email'>$email</a>";
add_shortcode('email', 'sc_email');
doitlikejustin /
Created Aug 4, 2013
Add invisible Mac dock spacer
defaults write persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'; killall Dock
You can’t perform that action at this time.