Skip to content

Instantly share code, notes, and snippets.

View ericlbarnes's full-sized avatar
🎵
git push it, git push it real good

Eric Barnes ericlbarnes

🎵
git push it, git push it real good
View GitHub Profile
@ericlbarnes
ericlbarnes / cicontroller TextMate Bundle
Created November 2, 2009 19:23
Controller TextMate Bundle
#!/usr/bin/env php
<?php
$name = $_ENV['TM_FILENAME'];
$class = str_replace('.php', '', $name);
$class = ucfirst($class);
$relative = str_replace($_ENV['TM_PROJECT_DIRECTORY'], '.', $_ENV['TM_FILEPATH']);
$out = <<<CORPUSCLE
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
// ------------------------------------------------------------------------
/**
* Validate the username
*
* @access public
* @return string
*/
public function username_check($username)
{
Header unset ETag
FileETag None
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|js)$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Ice {
var $return_data;
function Ice()
{
$this->EE =& get_instance();
}
@ericlbarnes
ericlbarnes / time_since.php
Created August 26, 2011 12:45
PHP::time_since
// ------------------------------------------------------------------------
/**
* Timespan
*
* Returns a span of seconds in this format:
* 10 days 14 hours 36 minutes 47 seconds
*
* @access public
* @param integer a number of seconds
@ericlbarnes
ericlbarnes / index.blade.php
Created April 5, 2012 12:08
blade comments test
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div class="first"></div>
{{--
@ericlbarnes
ericlbarnes / Template.php
Created July 29, 2012 03:05
CodeIgniter Template
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template {
/**
* CI Object
*
* @access protected
* @var object
*/
@ericlbarnes
ericlbarnes / common.php
Created July 29, 2012 03:50
Stringify Attributes
/**
* Stringify attributes for use in html tags.
*
* Helper function used to convert an array or object of
* attributes to a string
*
* @param mixed
* @return string
*/
function _stringify_attributes($attributes, $js = FALSE)
@ericlbarnes
ericlbarnes / Preferences.json
Created August 20, 2012 18:12
Sublime Text Preferences
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"fade_fold_buttons": false,
"font_face": "Panic Sans",
"font_size": 12.0,
"highlight_line": true,
"line_padding_bottom": 4,
"line_padding_top": 4,
"rulers":
{{ email:form subject="Contact Form" to="eric@ericlbarnes.com" required="name" }}
{{ if error}}
<h1>Error</h1>
<ul>
{{ errors }}
<li>{{error}}</li>
{{ /errors }}
</ul>
{{ endif }}