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
doitlikejustin / bookmarklet-gmail-compose.md
Created Aug 16, 2013 — forked from lajlev/bookmarklet-gmail-compose.md
How to create a bookmarklet to compose funktion in gmail.
View bookmarklet-gmail-compose.md
  • Create a bookmark to Gmail.
  • Edit & paste following snippet into the url field.
javascript:var w=window,u='https://mail.google.com/mail/u/0/?ui=2&view=cm&fs=1&tf=1',l=document.location;try{ throw(0); } catch(z) {a =function(){if(!w.open(u,'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
doitlikejustin / watch_mail.sh
Created Aug 16, 2013
Monitor mail in Plesk
View watch_mail.sh
tail -F /usr/local/psa/var/log/maillog
@doitlikejustin
doitlikejustin / browser_caching.htaccess
Created Aug 4, 2013
Browser caching using Expires headers in .htaccess
View browser_caching.htaccess
## EXPIRES CACHING ##
<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
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
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
doitlikejustin / clear_open_with.sh
Created Aug 4, 2013
Fix Duplicate or Old Items on "Open With..." List in Mac OS X
View clear_open_with.sh
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user
@doitlikejustin
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) {
$email = 'ENCODED_EMAIL_ADDRESS';
return "<a href='mailto:$email'>$email</a>";
}
add_shortcode('email', 'sc_email');
@doitlikejustin
doitlikejustin / add_dock_space.sh
Created Aug 4, 2013
Add invisible Mac dock spacer
View add_dock_space.sh
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'; killall Dock
You can’t perform that action at this time.