Skip to content

Instantly share code, notes, and snippets.

View SeanJA's full-sized avatar
🦑
🦖

SeanJA SeanJA

🦑
🦖
View GitHub Profile
class CI_DB_active_record extends CI_DB_driver {
/**
* Select
*
* Generates the SELECT portion of the query
*
* @access public
* @param string
* @return CI_DB_active_record
*/
<?php
class date {
/**
* Display the time from now in a readable way
* @param int $targetTime
* @param int $now
* @return string
*/
<?php
ini_set("include_path", "..".PATH_SEPARATOR."../../..".PATH_SEPARATOR.ini_get("include_path"));
require_once 'PHPUnit/Framework.php';
//include your json encoding classes, if you are using them
// /includes
//A version of http://twitter.com/gavinblair/statuses/24515252902 that will work everywhere as it does not rely on jQuery
var i=10,
elems = document.getElementsByTagName('a'),
exploder = setInterval(function(){
for(var e in elems){
(function(elem) {
if(elem.style){
elem.style.fontSize = i + 'px';
}
module ActiveModel
# == Active Model Confirmation Validator
module Validations
class ConfirmationValidator < EachValidator
def validate_each(record, attribute, value)
if (confirmed = record.send("#{attribute}_confirmation")) && (value != confirmed)
record.errors.add(attribute, :confirmation, options)
end
end
@SeanJA
SeanJA / wtf.txt
Created September 16, 2010 20:54
line 1 column 60 - Error: invalid formal public identifier "-//w3c//dtd html 4.0 transitional//en": invalid public text class
line 19 column 213 - Error: "NOSAVE" is not a member of a group specified for any attribute
line 21 column 18 - Error: an attribute value must be a literal unless it contains only name characters
line 27 column 22 - Error: an attribute value must be a literal unless it contains only name characters
line 31 column 22 - Error: an attribute value must be a literal unless it contains only name characters
line 35 column 22 - Error: an attribute value must be a literal unless it contains only name characters
line 39 column 22 - Error: an attribute value must be a literal unless it contains only name characters
line 43 column 22 - Error: an attribute value must be a literal unless it contains only name characters
line 47 column 35 - Error: an attribute value must be a literal unless it contains only name characters
line 57 column 26 - Error: an attribute value must be a literal unless it cont
@SeanJA
SeanJA / ie.css
Created September 27, 2010 23:41
hr {margin:-8px auto 11px;}
<?php
include 'classes/markdown.php';
$parser = new Markdown();
//Transform text using parser.
echo $parser->transform($text);
<?php
//to have multiple sidebars in wordpress:
function mytheme_widgets_init() {
register_sidebar(array(
'name' => __( 'sidebar1', 'mytheme' ),
'id' => 'sidebar1-area',
'description' => __( 'The first sidebar area', 'mytheme' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2>',
@SeanJA
SeanJA / php_shorttags.sh
Created October 28, 2010 13:31
grep php short tags
grep -r "<?[^php]" *.php