This file contains hidden or 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
/*Created by http://freehtml5templates.com | |
reset*/ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
@font-face { | |
font-family: AdamskySFRegular; | |
src: url('adma-webfont.eot'); | |
src: url('adma-webfont.eot?#iefix') format('embedded-opentype'), url('adma-webfont.woff') format('woff'), url('adma-webfont.ttf') format('truetype'), url('adma-webfont.svg#AdamskySFRegular') format('svg'); |
This file contains hidden or 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
public static function filter_post_content_out_7( $content, $post ) | |
{ | |
$regex = '%\[(\w+?)(?:\s+(.+?))?/\]|\[(\w+?)(?:\s+(.+?))?(?<!/)](?:(.*?)\[/(\w+?)])%si'; | |
if(preg_match($regex, $content, $matches)) { | |
$matches = array_pad($matches, 6, ''); | |
$code = $matches[1] . $matches[3]; | |
$attrs = $matches[2] . $matches[4]; | |
$code_contents = $matches[5]; | |
preg_match_all('#(\w+)\s*=\s*(?:(["\'])?(.*?)\2|(\S+))#i', $attrs, $attr_match, PREG_SET_ORDER); |
This file contains hidden or 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
public function filter_posts_get_update_preset($preset_parameters, $presetname, $paramarray) { | |
switch($presetname) { | |
case 'home': | |
$notallinfo = isset($preset_parameters['not:all:info']) ? Utils::single_array($preset_parameters['not:all:info']) : array(); | |
$notallinfo['debate'] = 0; | |
$preset_parameters['not:all:info'] = $notallinfo; | |
break; | |
} | |
return $preset_parameters; | |
} |
This file contains hidden or 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
public function act_display($paramarray = array( 'user_filters'=> array() )) { | |
$user_filters = array('all:info' => array( 'debate' => '0' ), 'content_type' => 'entry'); | |
$paramarray['user_filters'] = array_merge($user_filters, $paramarray['user_filters']); | |
parent::act_display( $paramarray ); | |
} |
This file contains hidden or 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 | |
class Test extends Plugin | |
{ | |
public function action_init() | |
{ | |
// Not sure what the heck this was for. | |
$this->add_template('block.pbi', dirname( __FILE__ ) . '/block.pbi.php' ); | |
$this->add_rule( |
This file contains hidden or 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
public function assert_associative_equal($value1, $value2, $message = 'Assertion failed', $output = null) | |
{ | |
$fn = function($value1, $value2) use (&$fn) { | |
foreach($value1 as $k => $v) { | |
if(is_scalar($v)) { | |
if(!is_scalar($value2[$k]) || $value2[$k] != $v) { | |
return false; | |
} | |
} | |
elseif(is_object($v)) { |
This file contains hidden or 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
/** | |
* Check for the existence of a cookie, and return a user object of the user, if successful | |
* @return User user object, or false if no valid cookie exists | |
*/ | |
public static function identify() | |
{ | |
$out = false; | |
// Let plugins set the user | |
if ( $out = Plugins::filter('user_identify', $out) ) { | |
self::$identity = $out; |
This file contains hidden or 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
Owen started coding at age eight and even then knew that it was his calling. After a 10+ year stint as a commercial desktop application developer in the oil industry, he turned to using his code knowledge for good by contributing to open source projects such as WordPress. As one of the founders of the Habari Project, he helps coders gain collaborative experience via open source. Owen now applies this cumulative coding and management experience in his internet consultancy, Critical Hit. In his spare time, Owen brews beer and teaches his two kids to play euro-style board games. |
This file contains hidden or 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 checkwin($board, $pos, $who) { | |
$set = ''; | |
foreach($pos as $pt) { | |
$set .= $board[$pt[1]][$pt[0]]; | |
} | |
if($set == str_repeat($who, 3)) return true; | |
return false; | |
} |
This file contains hidden or 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 seive($candidates, $min = 0, $max = 0) { | |
$primes = array(); | |
$last = ($max == 0) ? floor(end($candidates) / 2) : $max; | |
$i = ($min == 0) ? reset($candidates) : $min; | |
while($i <= $last) { | |
$candidates = array_filter($candidates, function($n) use ($i, &$primes) { | |
if($n < $i) { |