Skip to content

Instantly share code, notes, and snippets.

View deletosh's full-sized avatar

Dele Tosh deletosh

View GitHub Profile
@deletosh
deletosh / .htaccess
Created May 6, 2012 09:42
Yii .htaccess
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
@deletosh
deletosh / HTML::helper (kohana)
Created May 21, 2012 15:24
add the multiple scripts/styles in kohana
<?php defined('SYSPATH') or die('No direct script access.');
class HTML extends Kohana_HTML {
public static function scripts(array $scripts, $attributes=array(), $index = FALSE)
{
$response = '';
//Data sanitisation
$index = $index ? TRUE : false;
if ( !is_array($attributes) ) $attributes = array();
RewriteEngine On
RewriteBase /
RewriteRule ^(application|modules|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
@deletosh
deletosh / yii-htaccess
Created June 11, 2012 01:26
yii URL-ReWrite
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
@deletosh
deletosh / gist:2923868
Created June 13, 2012 12:48
git commands

delete a remote tag

If you have a tag named '12345' then you would just do this:

git tag -d 12345
git push origin :refs/tags/12345
```
@deletosh
deletosh / ide_helper.php
Created June 21, 2012 01:36
Laravel3 IDE Helper
<?php
class Auth extends Laravel\Auth {}
/**
* @method static add(string $name, string $source, array $dependencies = array(), array $attributes = array())
* @method static string styles()
* @method static string scripts()
*/
class Asset extends Laravel\Asset {}
class Autoloader extends Laravel\Autoloader {}
class Bundle extends Laravel\Bundle {}
@deletosh
deletosh / first-not all.sh
Created July 9, 2012 19:56
being first, but not all
--------------------------------------------------------------------------
I may not be the first,
or the last
or the only.
You might have loved before
You can love again.
If I loves you now, what else matters?
I'm not perfect - you aren't either,
the two of us may never be perfect together
@deletosh
deletosh / foundation.scss
Created July 16, 2012 17:47
foundation base import file
/***********************************************************************
*
* Uses the foundation framework with stylesheet source in SASS/Compass,
* to install, see: http://bit.ly/McPEag
* @dependancy: Ruby (on windows: DevKit: http://bit.ly/McPL5E)
*
**********************************************************************/
@import "settings";
@import "foundation/base";
<?php
require_once 'ControllerTestCase.php';
class AccountControllerTest extends ControllerTestCase
{
public function testSignupWithNoDataRedirectsAndHasErrors()
{
$response = $this->post('account@signup', array());
@deletosh
deletosh / autounit.rb
Created July 26, 2012 00:37
Autotest PHPUnit in Laravel
# PHPUnit: http://bit.ly/NYYCWs
# Ruby: http://rubyinstaller.org/ (Mac) *OR* http://rubyinstaller.org/ (Win)
# watchr: gem install watchr
# Growl: http://growl.info/ | http://bit.ly/NYYCWs (Mac) *OR* http://bit.ly/NYYrdF (Win)
# save in same level as 'artisan', then run watchr_imagesr autounit.rb
# src: http://bit.ly/NYZMRT
#watch just the test files (optionally superceeded by the next line)