Skip to content

Instantly share code, notes, and snippets.

View og-shawn-crigger's full-sized avatar

Shawn Crigger og-shawn-crigger

View GitHub Profile
@og-shawn-crigger
og-shawn-crigger / MY_Config.php
Created October 30, 2011 01:02
Start of reading/writing Config Options From Database
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Config extends CI_Config {
public function database()
{
if (function_exists('get_instance'))
{
$CI =& get_instance();
$query = $CI->db->get('config');
@og-shawn-crigger
og-shawn-crigger / loader.php
Created December 17, 2011 03:05
Loader for my Content Management system
<?php if ( !defined('BASE') ) die('No Direct Script Access');
/**
* Loader Class for VMS Content Management System
*
* @author Shawn Crigger <[email protected]>
* @version 1.0.5
* @copyright (c) 2010 - 2012 S-Vizion Software & Eagle Web Designs
* @package VisionManagementSystems
* @subpackage AssetLoader
* @since version 3.0BE
@og-shawn-crigger
og-shawn-crigger / MY_Config.php
Created January 16, 2012 16:34
MY_Config to extend HMVC CodeIgniter's Config class to use the database to fetch settings
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH.'third_party/MX/Config.php';
/*
Class: MY_Config
This is how I used to store my config items in the database, hopefully it will be found useful.
Extends:
MX_Config
@og-shawn-crigger
og-shawn-crigger / datatable_plugins.min.js
Created January 20, 2012 17:07
DataTable Plugin's file, add to /bonfire/application/core_modules/activities/assets/js
$.fn.dataTableExt.oPagination.listbox = {
/*
* Function: oPagination.listbox.fnInit
* Purpose: Initalise dom elements required for pagination with listbox input
* Returns: -
* Inputs: object:oSettings - dataTables settings object
* node:nPaging - the DIV which contains this pagination control
* function:fnCallbackDraw - draw function which must be called on update
*/
"fnInit": function (oSettings, nPaging, fnCallbackDraw) {
@og-shawn-crigger
og-shawn-crigger / robots.txt
Created January 26, 2012 00:09
Robots txt file for bonfire
user-agent: *
disallow: /assets/
disallow: /assets/images/
disallow: /assets/css/
disallow: /assets/js/
disallow: /classes/
disallow: /captcha/
disallow: /bonfire/
disallow: /bonfire/codeigniter/
disallow: /bonfire/application/confiq/
@og-shawn-crigger
og-shawn-crigger / MarkItUpInlineUpload.js
Created March 9, 2012 00:13 — forked from dkharrat/MarkItUpInlineUpload.js
upload feature for markitup...copied from http://pastebin.ca/1763467 as pastebin.ca seems to be down.
// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2008 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Html tags
// http://en.wikipedia.org/wiki/html
// ----------------------------------------------------------------------------
// Basic set. Feel free to add more tags
@og-shawn-crigger
og-shawn-crigger / newlayour.html
Created March 14, 2012 22:35
Basic Layout with Grid System and Bootstraped
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="http://localhost/layout/css/stylesheet.css" rel="stylesheet" type="text/css">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" >
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
<style>
body { background: url('http://www.preventionandwellbeing.net/images/bg.jpg') repeat;}
@og-shawn-crigger
og-shawn-crigger / Stop google spyware
Created March 30, 2012 16:03
Installs or updates Chromium (mac)
#!/bin/bash
mkdir /tmp/chromedownload && cd /tmp/chromedownload
curl http://build.chromium.org/f/chromium/snapshots/chromium-rel-mac/LATEST -o /tmp/chromedownload/LATEST --silent && LATEST=`cat /tmp/chromedownload/LATEST`
curl http://build.chromium.org/f/chromium/snapshots/chromium-rel-mac/$LATEST/chrome-mac.zip -o /tmp/chromedownload/chrome-mac.zip --silent
unzip -qq /tmp/chromedownload/chrome-mac.zip
cp -R /tmp/chromedownload/chrome-mac/Chromium.app /Applications
rm -rf /tmp/chromedownload
@og-shawn-crigger
og-shawn-crigger / css-nthchildn.js
Created April 4, 2012 18:15 — forked from meyertee/css-nthchildn.js
Modernizr Test 'nthchildn'
// Test for nth-child(...n) support
Modernizr.testStyles(" #modernizr div:nth-child(3n){width:10px;} ", function(elem, rule){
var bool = false, divs = elem.getElementsByTagName("div");
if (divs.length == 7){
var test = window.getComputedStyle ? function(i){
return getComputedStyle(divs[i], null)["width"] == "10px";
} : function(i){
return divs[i].currentStyle["width"] == "10px";
};
bool = !test(0) && !test(1) && test(2) && !test(3) && !test(4) && test(5) && !test(6);
@og-shawn-crigger
og-shawn-crigger / nocache.php
Created April 5, 2012 07:38
CodeIgniter Snippet to Force No Cache Headers
<?php
function set_nocache_headers()
{
$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");