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
var posts = [{ title: "How Crocodiles Cross Oceans", article: "How did the world's largest living reptile, the saltwater crocodile, reach so many South Pacific islands separated by huge stretches of water despite being a poor swimmer? Apparently, like a surfer catching a wave, these goliaths can ride currents on the ocean surface to cross large areas of open sea, researchers now reveal. The saltwater or estuarine crocodile (Crocodylus porosus) is a ferocious giant that can grow at least 23 feet long (7 meters) and weigh more than 2,200 pounds (1000 kilograms). These scaly monsters have been known to devour sharks, and even attack things they can't eat, often assaulting boats in the mistaken belief they are rivals or prey, biting down with nearly 2 tons of pressure — powerful enough to crush bone or punch through aluminum hulls..." }, { title: "Lemur Species", article: "Exact classification of some types of lemurs is a subject of debate, but it's generally accepted that there are five families of lemurs with a |
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
var tasks = []; | |
function display() { | |
var output = ""; | |
for(i=0; i < tasks.length; i++) { | |
output += (i+1) + ". " + tasks[i] + "\n"; | |
} | |
alert(output); | |
} |
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 Dog(name) { | |
this.name = name; | |
} | |
Dog.prototype.bark = function () { | |
return this.name + " says bark bark!"; // Storing things on the prototype will be accessible to all dogs but will only take up memory in a single place once time. | |
}; | |
var dog1 = new Dog("Fido"); | |
var dog2 = new Dog("Snoopy"); | |
dog1.bark(); // Fido says bark bark! |
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 |
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
/* jQuery Color Cycle Plugin - v0.1.1 - created by: [email protected] */ | |
(function ($) { | |
$.fn.colorCycle = function( options ) { | |
var settings = $.extend({ | |
colors: ['#ff0000', '#ff6600', '#ff9900', '#ffcc00', '#ffff00', '#ccff00', '#99ff00', '#66ff00', '#00ff66', '#00ff99', '#00ffcc', '#00ffff', '#00ccff', '#0099ff', '#0066ff', '#0033ff', '#0000ff', '#3300ff', '#6600ff', '#9900ff', '#cc00ff', '#ff00ff', '#ff00cc', '#ff0099', '#ff0066'], | |
animationStartRange: 1000, | |
animationEndRange: 2000, | |
loopStartRange: 1000, |
NewerOlder