Skip to content

Instantly share code, notes, and snippets.

@veganista
veganista / UsersControllerTest.php
Created May 4, 2012 20:37
CakePHP Controller Tetsing
<?php
/* Users Test cases generated on: 2012-03-13 19:59:39 : 1331668779*/
App::uses('UsersController', 'Controller');
/**
* TestUsersController *
*/
class TestUsersController extends UsersController {
/**
* Auto render
@veganista
veganista / check.sql
Created July 21, 2011 11:13
Sql For checking if wordpress is infected with some malicious links
SELECT
*
FROM
wp_posts
WHERE
post_content LIKE '%basicpills.com%'
OR post_content LIKE '%getrxpills.com%'
OR post_content LIKE '%antibiotics-shop.com%'
OR post_content LIKE '%generic-ed-pharmacy.com%'
OR post_content LIKE '%rx-prices.com%'
<a href="http://(basicpills.com|getrxpills.com|antibiotics-shop.com|generic-ed-pharmacy.com|rx-prices.com|hotspill.com).+?(</a>)
@veganista
veganista / snippet.php
Created June 16, 2011 13:16
Loading another page's content in wordpress
<?php
$page = get_page_by_path('page-parts/testimonials-intro');
//echo do_shortcode($page->post_content);
echo do_shortcode(wpautop($page->post_content)); // this will add the paragaphs automatically this can be a bit more useful than the above
?>
@veganista
veganista / gist:1016987
Created June 9, 2011 15:31
Applications view
<div class="applicants form">
<?php echo $this->Form->create('PrimaryApplicant', array('url' => array('controller' => 'applications', 'personal')));?>
<?php echo $this->element('forms/personal'); ?>
<?php echo $this->Form->submit('Continue', array('div' => false)); ?>
<?php echo $this->Form->submit('Cancel', array('name' => 'Cancel', 'div' => false, 'class' => 'cancel')); ?>
<?php echo $this->Form->end();?>
</div>
$this->loadModel('RoundLength');
$this->set('round_lengths', $this->RoundLength->find('list'));