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 | |
// with the above we can now do things like this: | |
foreach ( posts_loop() as $p ) { | |
get_template_part( 'content', 'page' ); | |
comments_template( '', true ); | |
} | |
// put this below in your functions.php: |
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 | |
require_once( 'custom_page.php' ); | |
class Hello_World_Page extends Tomjn_Custom_Page { | |
public function render_page() { | |
echo 'hello world!'; | |
} | |
} |
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 | |
/** | |
* A helper class to implement arbitrary content at arbitrary URLs without a supporting post or page. | |
* Inherit from this class and implement the render_page method | |
* | |
* @author: Tom J Nowell ww.tomjn.com | |
* @License: GPL 2+ | |
*/ | |
abstract class Tomjn_Custom_Page { |
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
local slots ={} | |
function plantTree() | |
turtle.select(1) | |
turtle.place() | |
end | |
function chopTree() | |
turtle.select(4) | |
turtle.dig() |
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
--[[ | |
TExcavate by Tom J Nowell | |
A modified version of the excavate command, mines 3 layers of rock at a time, and keeps persistent variables | |
requires: http://www.computercraft.info/forums2/index.php?/topic/1195-132-yet-another-persistent-variables-api-uses-metatable/ | |
]]-- | |
os.loadAPI("apis/persistentVar") -- Only use this line if you copied the API in your computers apis folder | |
local state = persistentVar:new( "/vars_texcavate/" ) |
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 | |
/* | |
Plugin Name: Twitter Follower Audit Tracker | |
Plugin URI: http://interconnectit.com/products/the-auditor/ | |
Description: Uses the auditor to track twitter follower counts, requires v1.63+ | |
Author: Tom J Nowell, interconnect/it | |
Version: 1.1 | |
Author URI: http://interconnectit.com | |
*/ |
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 | |
if ( ! function_exists( 'shortcode_exists' ) ) { | |
/** | |
* Check if a shortcode is registered in WordPress. | |
* | |
* Examples: shortcode_exists( 'caption' ) - will return true. | |
* shortcode_exists( 'blah' ) - will return false. | |
*/ | |
function shortcode_exists( $shortcode = false ) { | |
global $shortcode_tags; |
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
Have you tried using git to do that? |
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 | |
function indicator_colour( $indicator_colour ) { | |
return 'yellow'; | |
} | |
add_action( 'tomjn_indicator_colour', 'indicator_colour' ); |
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 | |
function indicator_helloworld( $indicator_text ) { | |
return 'Hello World!!!'; | |
} | |
add_action( 'tomjn_indicator_text', 'indicator_helloworld' ); |