Skip to content

Instantly share code, notes, and snippets.

@kaptinlin
kaptinlin / functions.php
Created May 15, 2012 14:58
Striking custom theme functions.php fix
<?php
/* Load the Theme class. */
require_once (get_stylesheet_directory() . '/framework/theme.php');
$theme = new Theme();
$options = include(get_template_directory() . '/framework/info.php');
$options['theme_child_name'] = 'Striking Child';
$options['theme_slug'] = 'striking';
$theme->init($options);
@kaptinlin
kaptinlin / timthumb.php
Created October 19, 2011 02:31
TimThumb with relative path for wordpress themes
<?php
/**
* TimThumb by Ben Gillbanks and Mark Maunder
* Based on work done by Tim McDaniels and Darren Hoyt
* http://code.google.com/p/timthumb/
*
* GNU General Public License, version 2
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Examples and documentation available on the project homepage
@kaptinlin
kaptinlin / Comments.php
Created September 26, 2011 19:28
lithium mysql hasMany relationship add unwanted data when no relationship data.
<?php
namespace app\models;
class Comments extends \lithium\data\Model {
public $validates = array();
}
?>
@kaptinlin
kaptinlin / tweet.js
Created August 25, 2011 15:38
tweet with localization support
// jquery.tweet.js - See http://tweet.seaofclouds.com/ or https://github.com/seaofclouds/tweet for more info
// Copyright (c) 2008-2011 Todd Matthews & Steve Purcell
(function($) {
$.fn.tweet = function(o){
var s = $.extend({
username: null, // [string or array] required unless using the 'query' option; one or more twitter screen names (use 'list' option for multiple names, where possible)
list: null, // [string] optional name of list belonging to username
favorites: false, // [boolean] display the user's favorites instead of his tweets
query: null, // [string] optional search query (see also: http://search.twitter.com/operators)
avatar_size: null, // [integer] height and width of avatar if displayed (48px max)