Skip to content

Instantly share code, notes, and snippets.

function load_main($view = '', $view_data = array(), $return = FALSE)
{
$this->set('nav_list', array('Home', 'Photos', 'About', 'Contact'));
$this->load('template', $view, $view_data, $return);
// $this->load('template2' $view, $view_data, $return);
}
Corresponding code in your controller:
@tim-peterson
tim-peterson / jquery.sparkline.mod.js
Created June 4, 2012 12:58
Modified jquery.sparkline.js-to attempt to make dynamic page loading to work, changed lines 375 and 586
/**
*
* jquery.sparkline.js
*
* v2.0
* (c) Splunk, Inc
* Contact: Gareth Watts (gareth@splunk.com)
* http://omnipotent.net/jquery.sparkline/
*
* Generates inline sparkline charts from data supplied either to the method
$out = array();
$myArray=array(
array(
'date' => '2011-05-13',
'value' => 2
),
array(
'date' => '2011-05-14',
'value' => 5
),
@tim-peterson
tim-peterson / nginx.conf
Created August 29, 2012 19:12
full nginx.conf for mysite.com
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http{
@tim-peterson
tim-peterson / ApplicationsMNPPconfnginxsites-enableddefault
Created September 13, 2012 03:25
MNPP /Applications/MNPP/conf/nginx/sites-enabled/default file
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /Applications/MNPP/Library/nginx/html;
@tim-peterson
tim-peterson / ApplicationsMNPPconfnginxnginx.conf
Created September 13, 2012 03:26
MNPP /Applications/MNPP/conf/nginx/nginx.conf
user www;
worker_processes 5;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@tim-peterson
tim-peterson / mysql.users
Created September 13, 2012 16:54
mysql.users
mysql> SELECT User,Host FROM mysql.user;
+------------------+------------------+
| User | Host |
+------------------+------------------+
| root | % |
| timrpeterson | % |
| root | 10.249.72.90 |
| root | 127.0.0.1 |
| root | 127.0.0.1:81 |
@tim-peterson
tim-peterson / fixed read replica config
Created September 19, 2012 14:04
fixed read replica config
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Readreplica {
public function Readreplica(){
$config['hostname'] = "myReadReplica.com";
$config['username'] = "xxxxxx";
$config['password'] = "xxxxxx";
$config['database'] = "myDB";
@tim-peterson
tim-peterson / font-awesome.min.css
Created September 23, 2012 15:22
font-awesome.min.css
@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot');src:url('../font/fontawesome-webfont.eot') format('embedded-opentype'),url('../font/fontawesome-webfont.woff') format('woff'),url('../font/fontawesome-webfont.ttf') format('truetype'),url('../font/fontawesome-webfont.svgz#FontAwesomeRegular') format('svg'),url('../font/fontawesome-webfont.svg#FontAwesomeRegular') format('svg');font-weight:normal;font-style:normal}[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:inherit;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat}li[class^="icon-"],li[class*=" icon-"]{display:block}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:FontAwesome;font-weight:normal;font-style:normal;display:inline-block;text-decoration:inherit}a [class^="icon-"],a [class*=" icon-"]{display:inline-block;text-decoration:inherit}.icon-large:before{vertical-align:top;font-size:1.3333333333333333em}.btn [class^="icon-"],.btn [c
@tim-peterson
tim-peterson / jqueryui.autocomplete.js
Created October 27, 2012 14:28
jqueryui.autocomplete.js
/*!
* jQuery UI Autocomplete 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete
*
* Depends: