Skip to content

Instantly share code, notes, and snippets.

You can't expect to win unless you know why you'll lose. - Benjamin Lipson
james-rumbelows-macbook:Downloads Jamie$ sudo gem install mysql
Password:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
Let them in
by Jamie Rumbelow
C#m G#m F#m A
Take a breath and learn your name,
Take a hold and play the game,
You don’t know what to do at all,
What do I do who do I call?
Ruby Wins
by James CF
C#m G#m F#m A
Use a block to print your name,
Use equality to test the same,
Blocks and lambdas you can call,
Private methods, send from all.
<?php
if (file_exists(get_template_directory() . '/pages/' . $post->post_name . '.php')) {
include(get_template_directory() . '/pages/' . $post->post_name . '.php');
} else {
get_header();
?>
<div id="post">
<h3><?=$post->post_title?></h3>
<div class="image">
<h2 id="page-title"><?=$post->post_title?></h2>
<?php
/*
SimpleTest + CodeIgniter
test.php
the test runner - loads all needed files,
integrates with CodeIgniter and runs the tests
by Jamie Rumbelow
http://jamierumbelow.net/
<?php
// line 22 +
if (!isset($_GET['test'])) {
//What are we testing?
$files = array();
if (isset($_GET['controllers'])) {
$files = @scandir(ROOT . 'application/tests/controllers');
} elseif (isset($_GET['models'])) {
<?php
//line 20+
//Capture CodeIgniter output, discard and load system into $CI variable
ob_start();
include(ROOT . 'index.php');
$CI =& get_instance();
ob_end_clean();
<?php
//line 19
function add_test($file, &$test) {
$implementation = '';
if (preg_match('/_controller/', $file) {
$controller = preg_replace('#' . ROOT . 'application/tests/controllers/([a-zA-Z0-9_\-])_controller_test.php#', '$1', $file);
$implementation = ROOT . 'application/controllers/'.$controller.'.php';
} elseif (preg_match('/_model/', $file) {
<?php
//line 41
class CodeIgniterUnitTestCase extends UnitTestCase {
protected $ci;
public function __construct() {
parent::UnitTestCase();
$this->ci =& get_instance();
}