Skip to content

Instantly share code, notes, and snippets.

View dogmatic69's full-sized avatar
🎯
Building the new IKEA

Carl Sutton dogmatic69

🎯
Building the new IKEA
View GitHub Profile
<?php
// add this code to $ip/extentions/Gist/Gist.php
// include this in your LocalSettings.php require_once( "$IP/extensions/Gist/Gist.php" );
// Usage <gist>{id}</gist>
$wgHooks['ParserFirstCallInit'][] = 'efGistParserInit';
function efGistParserInit(&$parser) {
$parser->setHook( 'gist', 'efGistRender' );
<?php
class GoogleAppHelper extends AppHelper{
public function __construct($options = array()){
$default = array(
'cachePath' => dirname(dirname(dirname(__FILE__))).DS.'webroot'.DS.'img'.DS.get_class($this).DS,
'cacheImagePath' => '/google/img/'.get_class($this).'/'
);
$options = array_merge($default, $options);
@dogmatic69
dogmatic69 / .htaccess
Created October 3, 2010 21:26
Using other apps with CakePHP
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (some_folder/.*) $1 [L] # adjust the regex to what you want.
# normal cake rules
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
@dogmatic69
dogmatic69 / .htaccess
Created October 3, 2010 22:32
redirecting your sub domains
<IfModule mod_rewrite.c>
RewriteEngine on
# redirect all www traffic to non-www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# normal cakephp stuff
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
@dogmatic69
dogmatic69 / .gitconfig
Created October 11, 2010 00:22
my git config file, if you want to use it remember to change your username and email address
[color]
diff = auto
status = auto
branch = auto
[color "branch"]
current = yellow reverse
local = yellow
[color "diff"]
@dogmatic69
dogmatic69 / .bashrc
Created October 19, 2010 18:26
cakephp path for ubuntu10.10 - getting cake bake working
export PATH=$PATH:/var/www/frameworks/cakephp/cake/console
@dogmatic69
dogmatic69 / bashrc.sh
Created October 19, 2010 18:27
make git prompt more useful
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@dogmatic69
dogmatic69 / random.php
Created November 22, 2010 11:04
get random rows from a db
class RandomBehavior extends ModelBehavior
{
public $name = 'Random';
@dogmatic69
dogmatic69 / symlink_assets.php
Created November 23, 2010 22:03
link to plugin and theme assets in CakePHP
@dogmatic69
dogmatic69 / docs.php
Created November 26, 2010 16:09
base doc block for classes
/**
* Short Description / title.
*
* Overview of what the file does. About a paragraph or two
*
* Copyright (c) 2010 Carl Sutton ( dogmatic69 )
*
* @copyright Copyright (c) 2010 Carl Sutton ( dogmatic69 )
* @link http://www.infinitas-cms.org
* @package {see_below}