Skip to content

Instantly share code, notes, and snippets.

View jongrover's full-sized avatar

Jonathan Grover jongrover

View GitHub Profile
@jongrover
jongrover / functions.php
Created December 2, 2019 18:38 — forked from elimn/functions.php
MT | TEC | Change past event views to reverse chronological order
<?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);
}
@jongrover
jongrover / archive-product.php
Created April 8, 2019 20:43 — forked from peltopiri/archive-product.php
WooCommerce - Nested Category/Subcategory Layout, FIXED: show subcategory content
<?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
@jongrover
jongrover / archive-product.php
Created April 8, 2019 20:43 — forked from torbentschechne/archive-product.php
WooCommerce - Nested Category/Subcategory Layout
<?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
@jongrover
jongrover / slim-redux.js
Created June 24, 2016 18:05 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
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])) {
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "someone@somewhere.com"
@from = "must_be_same_as_smpt_account_login@gmail.com"
@subject = "test from the Rails Console"
@body = "This is a test email"
end
end
@jongrover
jongrover / hacker-radiio
Created March 15, 2016 11:59 — forked from jars/hacker-radiio
Music For Hackers
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