Skip to content

Instantly share code, notes, and snippets.

View mikedfunk's full-sized avatar

Mike Funk mikedfunk

View GitHub Profile
@mikedfunk
mikedfunk / gist:1304755
Created October 21, 2011 19:47
loading_in test
// --------------------------------------------------------------------------
/**
* loading_in
*/
module ('', {
setup: function()
{
var the_html = '<a class="click_me">initial text</a>';
$('#qunit-fixture').html(the_html);
},
@mikedfunk
mikedfunk / gist:1304759
Created October 21, 2011 19:48
loading_in
// --------------------------------------------------------------------------
/**
* loading_in function.
*
* @return void
*/
function loading_in($this)
{
if ($this !== undefined)
@mikedfunk
mikedfunk / gist:1304787
Created October 21, 2011 19:55
qunit test
test('loading_in()', function()
{
// setup
var the_html = '<a class="click_me">initial text</a>';
$('#qunit-fixture').html(the_html);
// run function
loading_in($('a.click_me'));
// test
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Authors Model
*
* All model methods related to authors.
*
* @license Commercial
* @author Mike Funk
* @link http://xulonpress.com
* @email webmaster@xulonpress.com
@mikedfunk
mikedfunk / gist:1320603
Created October 27, 2011 19:33
loading in, loading out
/**
* Admin Scripts
*
* All javascript related to Xulon Press admin.
*
* @license Copyright Xulon Press, Inc. All Rights Reserved.
* @author Xulon Press
* @link http://xulonpress.com
* @email info@xulonpress.com
*
@mikedfunk
mikedfunk / gist:1320609
Created October 27, 2011 19:34
prevent link defaults, enable tinymce
/**
* admin actions
*
* Seperated from javascript functions for testing.
*
* @license Copyright Xulon Press, Inc. All Rights Reserved.
* @author Xulon Press
* @link http://xulonpress.com
* @email info@xulonpress.com
*
@mikedfunk
mikedfunk / gist:1370989
Created November 16, 2011 19:02
Using MySQL NOW() in Codeigniter
<?php
// Using MySQL NOW() in Codeigniter
// by daveganley
// There are two easy ways to do this
// With NOW()
$data = array(
'field_name' => 'some_data'
);
SELECT `bt_accounts`.`id`, `bt_payments`.`id`, `bt_payments`.`amount`, `bt_payments`.`date`, `bt_users`.`first_name`, `bt_users`.`last_name`
FROM (`bt_accounts`)
LEFT JOIN `bt_payments` ON `bt_payments`.`account_id` = `bt_accounts`.`id`
LEFT JOIN `bt_salespeople` ON `bt_salespeople`.`id` = `bt_accounts`.`salesperson_id`
LEFT JOIN `bt_users` ON `bt_users`.`salesperson_id` = `bt_salespeople`.`id`
ORDER BY `bt_payments`.`id` desc
SELECT `bt_accounts`.`id`, `bt_orders`.`id`, `bt_orders`.`amount`, `bt_orders`.`date`, `bt_orders`.`payment_complete`, `bt_users`.`first_name`, `bt_users`.`last_name`, `bt_users`.`email_address`, `bt_users_account`.`first_name` AS account_first_name, `bt_users_account`.`last_name` AS account_last_name
FROM (`bt_orders`)
LEFT JOIN `bt_prices` ON `bt_prices`.`id` = `bt_orders`.`price_id`
LEFT JOIN `bt_accounts` ON `bt_accounts`.`id` = `bt_orders`.`account_id`
LEFT JOIN `bt_users` AS bt_users_account ON `bt_users_account`.`id` = `bt_accounts`.`primary_user_id`
LEFT JOIN `bt_salespeople` ON `bt_salespeople`.`id` = `bt_orders`.`salesperson_id`
LEFT JOIN `bt_users` ON `bt_users`.`id` = `bt_salespeople`.`user_id`
ORDER BY `bt_orders`.`id` desc
LIMIT 10
@mikedfunk
mikedfunk / gist:1623321
Created January 16, 2012 22:12
Relative path
$relative_path = str_replace('//','/',dirname(__FILE__).'/');