Skip to content

Instantly share code, notes, and snippets.

View mikedfunk's full-sized avatar

Mike Funk mikedfunk

View GitHub Profile
@mikedfunk
mikedfunk / gist:1723681
Created February 2, 2012 14:21
HTML Purifier usage example for codeigniter
// html purifier
require_once $this->fcpath.$this->apppath.'libraries/htmlpurifier/library/HTMLPurifier.auto.php';
$this->ci->htmlpurifier = new HTMLPurifier();
$config = HTMLPurifier_Config::createDefault();
$this->html = $this->ci->htmlpurifier->purify($this->html, $config);
@mikedfunk
mikedfunk / gist:1839256
Created February 15, 2012 21:55
twitter bootstrap backdrop
/**
* backdrop function.
*
* creates twitter bootstrap backdrop, optional callback
*
* @access public
* @param mixed callback
* @return void
*/
@mikedfunk
mikedfunk / MY_Session.php
Created February 22, 2012 16:26
adds all_flashdata to session class
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* MY_Session
*
* Adds all_flashdata
*
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @author Mike Funk
* @link http://mikefunk.com
* @email mike@mikefunk.com
@mikedfunk
mikedfunk / gist:1903888
Created February 24, 2012 21:31
PHPUnit CodeIgniter library mock example
<?php
// inside the test class...
// mock
require_once(BASEPATH.'libraries/email.php');
$this->_ci->email = $this->getMock('CI_Email');
$this->_ci->email->expects($this->any())
->method('send')
->will($this->returnValue(true));
$this->assertTrue($this->_ci->email->send());
@mikedfunk
mikedfunk / gist:1979874
Created March 5, 2012 18:00
email example
<?php
$to = 'mikedfunk@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: admin@bookymark.com';
if (mail($to, $subject, $message, $headers))
{
echo "mail test 2 successful \n\n";
}
@mikedfunk
mikedfunk / README.md
Created March 28, 2012 16:51
Query String Helper

Query String Helper

A CodeIgniter helper to manipulate and return the current/new query string.

Usage

  • Place query_string_helper.php in application/helpers.
  • Load helper with $this-&gt;load-&gt;helper('query_string_helper')
@mikedfunk
mikedfunk / gist:2344500
Created April 9, 2012 16:18
IE Multiple Submit Button Test
<!doctype HTML>
<html>
<head>
<title>IE Submit button test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<style type="text/css">
body {
padding: 40px;
}
@mikedfunk
mikedfunk / gist:2344684
Created April 9, 2012 16:50
IE Multiple Submit Button Test - Working
<!doctype HTML>
<html>
<head>
<title>IE Submit button test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<style type="text/css">
body {
padding: 40px;
}
@mikedfunk
mikedfunk / config.php
Created April 12, 2012 19:35
Curl load library
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* contest_config_library
*
* Config for the library to get the contest config via CURL or config->load().
*
* @license Copyright Xulon Press, Inc. All Rights Reserved.
* @author Xulon Press
* @link http://xulonpress.com
* @email info@xulonpress.com
@mikedfunk
mikedfunk / gist:2577564
Created May 2, 2012 15:35
relevant carabiner portion of template.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* template_view
*
* Description
*
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @author Mike Funk
* @link http://mikefunk.com
* @email mike@mikefunk.com