Skip to content

Instantly share code, notes, and snippets.

Avatar
🎵
git push it, git push it real good

Eric Barnes ericlbarnes

🎵
git push it, git push it real good
View GitHub Profile
View cicontroller 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');
/**
View username_check.php
// ------------------------------------------------------------------------
/**
* Validate the username
*
* @access public
* @return string
*/
public function username_check($username)
{
View .htaccess
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
View gist:472518
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Ice {
var $return_data;
function Ice()
{
$this->EE =& get_instance();
}
View time_since.php
// ------------------------------------------------------------------------
/**
* 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
View index.blade.php
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div class="first"></div>
{{--
@ericlbarnes
ericlbarnes / Template.php
Created Jul 29, 2012
CodeIgniter Template
View Template.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template {
/**
* CI Object
*
* @access protected
* @var object
*/
@ericlbarnes
ericlbarnes / common.php
Created Jul 29, 2012
Stringify Attributes
View common.php
/**
* 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 Aug 20, 2012
Sublime Text Preferences
View Preferences.json
{
"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":
View email_form.html
{{ email:form subject="Contact Form" to="eric@ericlbarnes.com" required="name" }}
{{ if error}}
<h1>Error</h1>
<ul>
{{ errors }}
<li>{{error}}</li>
{{ /errors }}
</ul>
{{ endif }}