Skip to content

Instantly share code, notes, and snippets.

@asp24
asp24 / flush_cache.php
Last active October 18, 2019 20:34
Script for flushing bytecode cache
<?php
/**
* Script for flushing bytecode cache
*
* usage:
* php flush_cache.php unix:///var/run/php5-fpm.sock
* php flush_cache.php 127.0.0.1 9000
*
* Change SECRET bellow before use!
//
// returns a list of all elements under the cursor
//
function elementsFromPoint(x,y) {
var elements = [], previousPointerEvents = [], current, i, d;
// get all elements via elementFromPoint, and remove them from hit-testing in order
while ((current = document.elementFromPoint(x,y)) && elements.indexOf(current)===-1 && current != null) {
// push the element and its current style
@addyosmani
addyosmani / example.js
Created February 11, 2012 01:02
Mediator pattern
// Example 1
mediator.name = 'Doug';
mediator.subscribe('nameChange', function(arg){
console.log(this.name);
this.name = arg;
console.log(this.name);
});
mediator.publish('nameChange', 'Jorn');
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.