Skip to content

Instantly share code, notes, and snippets.

View psynewave's full-sized avatar

Mark Flavin psynewave

View GitHub Profile
@psynewave
psynewave / gist:4039711
Created November 8, 2012 15:59
IE Conditional Firebug lite
<!--[if IE]>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
<![endif]-->
@psynewave
psynewave / gist:3960513
Created October 26, 2012 18:25
PHP Median Function
function median($numbers){
//loop through each value in the array and if it is a number add it to a new array
foreach ($numbers as $num) {
if(is_numeric($num)){
$num_array[]=$num;
}
}
rsort($num_array); //sort the array for our operation
@psynewave
psynewave / User_Shortcodes
Created February 4, 2012 09:31
Wordpress User Info Short Code
// display content to logged in users via shortcode
function member_only($atts, $content = null) {
if (is_user_logged_in())
return '<div class="memberContent">' . do_shortcode($content) . '</div>';
return '';
}
add_shortcode('member_only', 'member_only');
// display content to logged out users via shortcode
function non_member($atts, $content = null) {