Skip to content

Instantly share code, notes, and snippets.

View peschee's full-sized avatar
Grabbing another coffee…

Peter Siska peschee

Grabbing another coffee…
View GitHub Profile
git init
git submodule add git://github.com/kohana/core.git system
git submodule add git://github.com/kohana/database.git modules/database
git submodule add http://github.com/kohana/userguide.git modules/userguide
git submodule add http://github.com/kohana/image.git modules/image
git submodule add http://github.com/kohana/codebench.git modules/codebench
git submodule add http://github.com/kohana/auth.git modules/auth
git submodule add http://github.com/kohana/pagination.git modules/pagination
git submodule add http://github.com/kohana/orm.git modules/orm
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
@peschee
peschee / gist:878229
Created March 20, 2011 09:25
HTML boilerplate
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>title</title>
@peschee
peschee / gist:900278
Created April 3, 2011 08:11
Get dimensions from a hidden DOM element
$.fn.getHiddenDimensions = function(includeMargin) {
var $item = this,
props = { position: 'absolute', visibility: 'hidden', display: 'block' },
dim = { width:0, height:0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 },
$hiddenParents = $item.parents().andSelf().not(':visible'),
includeMargin = (includeMargin == null)? false : includeMargin;
var oldProps = [];
$hiddenParents.each(function() {
var old = {};
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Multiple if statements, or a switch statement,
// can handle as many environments as you need
if ($_SERVER['HTTP_HOST'] == "local-site.dev") {
$active_group = 'expressionengine';
} else {
$active_group = 'enginehosting';
}
@peschee
peschee / gist:980813
Created May 19, 2011 14:01
Remove array values
$arr = array_merge(array_diff($arr, array('values', 'to be', 'removed')));
@peschee
peschee / gist:1279027
Created October 11, 2011 18:52
Add your own Twig extensions in Silex
// additional twig extensions
$oldTwigConfiguration = isset($app['twig.configure']) ? $app['twig.configure']: function(){};
$app['twig.configure'] = $app->protect(function($twig) use ($oldTwigConfiguration) {
$oldTwigConfiguration($twig);
$twig->addExtension(new Some\Twig\Extension());
});

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

@peschee
peschee / gist:5589567
Created May 16, 2013 05:21
Homebrew doctor issues
brew prune
brew cleanup
brew update
brew tap --repair
brew doctor