Skip to content

Instantly share code, notes, and snippets.

View androa's full-sized avatar

André Roaldseth androa

View GitHub Profile
@androa
androa / Bootstrap.php
Created May 31, 2012 12:25
Lazyloading resources from the Zend Framework bootstrap
<?php
/**
* Example Zend Framework bootstrap with lazyloading of resources
*
* @author André Roaldseth <andrer@vg.no>
*/
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
/**
* Creates a lazyloaded Memcached instance
*
@androa
androa / updateUserAgent.html
Created February 22, 2012 12:29
Detecting old browsers
<style type="text/css">
#warningBox div { display: none; }
</style>
<div id="warningBox">
<div class="opera">
<h1>Du bruker en eldre versjon av nettleseren Opera</h1>
<p>For å få en best mulig opplevelse av våre nettsider, anbefaler vi at du henter <a href="http://www.opera.no/browser/">nyeste versjon av Opera</a>. Bruker du en jobb-PC bør du kontakte IT-ansvarlig.</p>
@androa
androa / gist:805991
Created February 1, 2011 15:16
Testing both return value and E_NOTICE/E_USER_NOTICE
<?php
class ClassWithError {
public function multiplyByTen($value = 0) {
if (!$value) {
trigger_error('Value is missing', E_USER_NOTICE());
return false;
}
return $value * 10;
}