Skip to content

Instantly share code, notes, and snippets.

@weierophinney
weierophinney / Module.php
Last active June 17, 2016 09:11
404 listener in ZF2
<?php
class Module
{
public function onBootstrap($e)
{
$app = $e->getApplication();
$events = $app->getEventManager();
// Direct instantiation
$events->attach(new RouteNotFoundListener());
@chrisjlee
chrisjlee / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@claviska
claviska / jquery.offscreen.js
Created October 30, 2013 21:36
jQuery offscreen plugin
/*
* jQuery offscreen plugin
*
* Filters that detect when an element is partially or completely outside
* of the viewport.
*
* Usage:
*
* $('#element').is(':off-bottom')
*
packages:
yum:
newrelic-php5: []
rpm:
newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
commands:
configure_new_relic:
command: newrelic-install install
env:
NR_INSTALL_SILENT: true
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@claviska
claviska / rest.class.php
Created August 30, 2012 18:20
Barebones PHP-based REST client
<?php
/*
Usage:
$rest = new REST($config);
$result = $rest->get('http://example.com/method, array(
'name' => 'value',
...
));
@nateabele
nateabele / SepiaToneFilter.php
Created April 13, 2012 20:59
Proof-of-concept sepia tone filter for Imagine. My math is probably rong.
<?php
namespace moneygram\extensions\imagine;
use Imagine\Image\Box;
use Imagine\Image\Point;
use Imagine\Image\Color;
class SepiaToneFilter implements \Imagine\Filter\FilterInterface {
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.