Skip to content

Instantly share code, notes, and snippets.

@simkimsia
simkimsia / bootstrap.php
Created October 30, 2013 10:12
my bootstrap and core for production
<?php
/**
* This file is loaded automatically by the app/webroot/index.php file after core.php
*
* This file should load/create any application wide configuration settings, such as
* Caching, Logging, loading additional configuration files.
*
* You should also use this file to include any files that provide global functions/constants
* that your application uses.
*
@simkimsia
simkimsia / error.log
Last active December 26, 2015 23:28
error.log
2013-10-30 10:15:10 Error: Fatal Error (256): [MissingPluginException] Plugin UtilityHelpers could not be found.
#0 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/Core/App.php(367): CakePlugin::path('UtilityHelpers')
#1 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/Core/App.php(228): App::pluginPath('UtilityHelpers')
#2 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/Core/App.php(549): App::path('View/Helper', 'UtilityHelpers')
#3 [internal function]: App::load('CDNAppHelper')
#4 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/storyzer/View/Helper/AppHelper.php(34): spl_autoload_call('CDNAppHelper')
#5 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/Core/App.php(547): include('/var/virtual/st...')
#6 [internal function]: App::load('AppHelper')
#7 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/View/Helper/FormHelper.php(30): spl_autoload_call('AppHelper')
#8 /var/virtual/storyzer.com/2013_10_30_09_49_48/src/lib/Cake/Core/App.php(547): include('/var/v
@simkimsia
simkimsia / gist:7336019
Created November 6, 2013 13:26
error message in shell when i try to run a command in .bashrc
orry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:
command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
@simkimsia
simkimsia / overlay.css
Created November 8, 2013 03:18
overlay
left: 0px;
top: 0px;
position: absolute;
display : block;
background: #ffffff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #4c4c4c 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#ffffff), color-stop(100%,#4c4c4c)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%,#4c4c4c 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%,#4c4c4c 100%); /* Opera 12+ */
@simkimsia
simkimsia / ExampleBehavior.php
Created November 14, 2013 02:40
Template of Behavior file in CakePHP Plugin
<?php
/**
* {ExampleBehavior} class file.
*
* {one line description}
*
* {elaboration of usage}
*
* Copyright {copyright year}, {maintainer}
* {Location}
<?php
/**
* ReplaceableBehavior class file.
*
* Replaces `unicorn` in an array with `super_duper_unicorn`
*
* Usage is straightforward:
* In model: $array = $this->replaceWithSuper($array);
*
* Copyright 2013, Kim Stacks
@simkimsia
simkimsia / ReplaceableBehavior.php
Created November 14, 2013 03:01
Method for the ReplaceableBehavior.php in https://gist.github.com/simkimsia/7460467
/**
* Replace all occurrences of unicorn in an array with super_duper_unicorn
*
* @param Model $Model
* @param array $array
* @return array
*/
public function replaceWithSuper(Model $Model, $array = array()) {
foreach ($array as $key => $value) {
if (is_string($value) && $value == 'unicorn') {
@simkimsia
simkimsia / AllPluginNameTest.php
Last active December 28, 2015 11:49
Template of PluginName test suite file
<?php
/**
* All{PluginName}Test test suite file
*
* will run ALL the tests for this CakePHP Plugin
*
* Copyright {copyright year}, {maintainer}
* {Location}
*
* Licensed under The MIT License
<?php
/**
* AllSuperDuperMakeUnicornsTest test suite file
*
* will run ALL the tests for this CakePHP Plugin
*
* Copyright 2013, Kim Stacks
* Singapore
*
* Licensed under The MIT License
@simkimsia
simkimsia / ExampleBehaviorTest.php
Last active December 28, 2015 11:49
Template for Behavior Test in CakePHP Plugin
<?php
/**
*
* {ExampleBehavior}BehaviorTest file
*
* PHP 5
*
* Copyright {copyright year}, {maintainer}
* {Location}
*