hostnamectl set-hostname radio nano /etc/hosts apt-get update && apt-get -y dist-upgrade && apt-get -y install gcc libcurl4-gnutls-dev libvorbis-dev libxslt1-dev pkg-config libtheora-dev libspeex-dev openssl last 3 are optional (libtheora-dev libspeex-dev openssl), not sure about pkg-config cd /usr/src/ wget tar -xzvf icecast-2.4.3.tar.gz cd icecast-2.4.3/ ./configure make make install # libshout cd /usr/src/ wget tar -xzvf… Continue reading

I’m sure there are tons of plugins for adding Google Analytics to your WordPress site, and a lot of themes have an area for pasting scripts. But if you ever want to just add the code without any of that, the simplest way is in your functions.php: add_filter( ‘wp_print_footer_scripts’, function(){     ?>     <script>   … Continue reading

Below are some optimized SVGs I’ve made using the official assets provided by the companies.  Feel free to grab the code for your own projects.  Alternatively, checkout the plugin. [socialmonger size=’7vw’ color=’#f66′ align=center padding=’0 1ex’] [/socialmonger] In case you’re not to familiar with SVGs, they are Vector Graphics… Continue reading

define( ‘WP_DEBUG’, true ); if ( WP_DEBUG ) { define( ‘WP_DEBUG_DISPLAY’, false ); define( ‘WP_DEBUG_LOG’, true ); @ini_set( ‘display_errors’, 0 ); define( ‘SCRIPT_DEBUG’, true ); } Continue reading

JavaScript <script>   // auto tab   (function(){     var maxLengthInputs = document.querySelectorAll(‘#myform input[maxlength]’);     for(var i=0, l = maxLengthInputs.length; i<l; i++){         maxLengthInputs[i].addEventListener(‘input’, autotab );     }     function autotab(e){         if ( this.value.length == this.maxLength){             var allInputs = document.querySelectorAll(‘#myform input’);             var index = 1 +… Continue reading

add_filter(‘wp_mail_from’, function($email){     if( substr($email,0,10) === ‘wordpress@’)         $email = get_option(‘admin_email’);     return $email; }); add_filter(‘wp_mail_from_name’, function($name){     if($name === ‘WordPress’)         $name = str_replace( ‘’’, “‘”, get_option(‘blogname’) );     return $name; }); Continue reading

document.addEventListener(‘DOMContentLoaded’, function(){     function exitWarning(e){         e.preventDefault();     }     function setExitWarning(){         window.addEventListener(‘beforeunload’, exitWarning );         this.removeEventListener(‘change’, setExitWarning );     }     var forms = document.querySelectorAll(‘main form’);          for ( var i = 0, l = forms.length; i < l; i++ ) {         forms[i].addEventListener(‘change’, setExitWarning );   … Continue reading

This is a pretty goofy function, but a client once deleted the default user roles using some plugin, and I just threw this into functions.php to re-create them. It’s hooked onto admin_init, so it runs when you load any back-end page.  I set a transient that keeps the function from running more than once (and… Continue reading

function readycat_keygen( $atts ) {          extract( shortcode_atts(         array(             ‘len’ => null,             ‘char’ => ‘ABCDEFGHJKMNPQRSTUVWXYZ23456789’,// don’t bother with I L 1 O or 0             ‘type’ => ‘count’,             ‘countby’ => null,             ‘pre’ => null,           … Continue reading