This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Changes past event views to reverse chronological order | |
function tribe_past_reverse_chronological ($post_object) { | |
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false; | |
if(tribe_is_past() || $past_ajax) { | |
$post_object = array_reverse($post_object); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Template for displaying product archives, including the main shop page which is a post type archive | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy and paste this to the rails console to test your email settings | |
class MyMailer < ActionMailer::Base | |
def test_email | |
@recipients = "[email protected]" | |
@from = "[email protected]" | |
@subject = "test from the Rails Console" | |
@body = "This is a test email" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Music For Hackers | |
== | |
To a hacker, there's something distracting about booting up a GUI to listen to your tunes. You live your life in the terminal, you treat the mouse like a high voltage tap. | |
So give these commands a run in the terminal, and toss on your headphones. | |
sudo apt-get install mplayer | |
echo "alias defcon-start='nohup mplayer http://sfstream1.somafm.com:6200 > /dev/null 1>&2 &'" >> ~/.bashrc | |
echo "alias defcon-stop='killall -9 mplayer'" >> ~/.bashrc |