Skip to content

Instantly share code, notes, and snippets.

View doitlikejustin's full-sized avatar

Justin Scarpetti doitlikejustin

View GitHub Profile
@doitlikejustin
doitlikejustin / sleep_display.txt
Created August 4, 2013 20:54
Turn off Mac display (hot keys)
ctrl + shift + eject
@doitlikejustin
doitlikejustin / remove_feeds.php
Created August 1, 2013 23:59
Remove Feeds in WordPress
remove_action( 'wp_head', 'feed_links', 2);
remove_action( 'wp_head', 'wlwmanifest_link');
remove_action( 'wp_head', 'wp_generator');
@doitlikejustin
doitlikejustin / no_www.htaccess
Created August 1, 2013 23:58
To WWW or not to WWW in .htaccess
#Force the no-www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
@doitlikejustin
doitlikejustin / triangles.html
Created August 1, 2013 23:56
HTML Triangle Entities
◄ = ◄
► = ►
▼ = ▼
▲ = ▲
▾ = ▾
@doitlikejustin
doitlikejustin / redirect.htaccess
Created August 1, 2013 23:54
Simple 301 Redirect
Redirect 301 /oldpage/ /newpage/
@doitlikejustin
doitlikejustin / disable_core_updates.php
Created August 1, 2013 23:51
Disable WordPress updates (functions.php)
//Diasable Core Updates # 3.0+
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
wp_clear_scheduled_hook( 'wp_version_check' );
@doitlikejustin
doitlikejustin / simple_shortcode.php
Created August 1, 2013 22:54
Simple WordPress shortcode
// goes in functions.php
// [simple]
function sc_simple($atts) {
return "this is some text";
}
add_shortcode('simple', 'sc_simple');
@doitlikejustin
doitlikejustin / change_user_group.sh
Created July 30, 2013 17:17
Changing Directory User and Group
chown -R USERNAME:psacln /var/www/vhosts/DOMAIN/httpdocs/ && chown USERNAME:psaserv /var/www/vhosts/DOMAIN/httpdocs/
@doitlikejustin
doitlikejustin / sql_replace.sh
Created July 26, 2013 20:30
Simple SQL REPLACE
UPDATE _table_ SET _field_ = REPLACE(_field_, '_old_value_', '_new_value_');
@doitlikejustin
doitlikejustin / reset_dns_lion.sh
Created July 26, 2013 20:29
Reset DNS cache in OS X Lion
sudo killall -HUP mDNSResponder