Skip to content

Instantly share code, notes, and snippets.

@meglio
meglio / PSR-0-final-proposal.md
Created October 12, 2011 06:35 — forked from Thinkscape/PSR-0-final-proposal.md
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory:

  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.
@meglio
meglio / support.pdf.js
Created October 27, 2012 10:10
JQuery PDF support detection
/*
* Check for PDF support
* Based on http://downloads.beninzambia.com/blog/acrobat_detection.js.txt
*/
$.support.pdf = (function() {
try {
// IE
if(!$.support.cssFloat) {
var control = null;
@meglio
meglio / denis-x.js
Last active August 29, 2015 13:56
Denis' generic utils for JS
RegExp.escape = function (text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
if (!Math.sqr) {
Math.sqr = function (x) {
return x * x;
}
}
@meglio
meglio / cors.nginxconf
Last active March 18, 2016 05:46 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTP proxy server
# enabling CORS only to domains matched by regex
#
server {
listen 80;
server_name corsproxy.mydomain.com;
location / {
proxy_redirect off;