This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
{% block html_tag %}<html lang="{% block lang 'en' %}">{% endblock %} | |
<head> | |
<meta charset="{% block charset 'utf-8' %}"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title>{% block title '' %}</title> | |
<meta name="description" content="{% block description '' %}"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
{% block head %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<style id="antiClickjack">body { | |
display: none !important; | |
}</style> | |
<script type="text/javascript"> | |
if(self === top) { | |
var antiClickjack = document.getElementById("antiClickjack"); | |
antiClickjack.parentNode.removeChild(antiClickjack); | |
} else { | |
top.location = self.location; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Originally from https://github.com/ebryn/rsvp-ajax | |
RSVP.ajax = { | |
_ajax: function (url, type, params, data) { | |
var promise = new RSVP.Promise(), | |
xhr = new XMLHttpRequest(); | |
if (params) { url = url + '?' + $.param(params); } | |
xhr.onreadystatechange = function (event) { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!(function () { | |
// Allow: <!--{ fullName }--> | |
// Instead of: <!-- ko text: fullName --><!-- /ko --> | |
// See: https://knockoutjs.com/documentation/binding-preprocessing.html | |
ko.bindingProvider.instance.preprocessNode = function (node) { | |
if (node.nodeType !== Node.COMMENT_NODE) { | |
return; | |
} | |
const match = node.nodeValue.match(/^[{](.*)[}]$/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const init = new function () { | |
let funcs = [], | |
booted = 0, | |
doc = document, | |
ready = fn => { | |
'loading' === doc.readyState ? | |
doc.addEventListener('DOMContentLoaded', fn) : | |
fn(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The DiscriminatorMap() annotation in an entity's class doc comment can be | |
* empty, but if it is, Doctrine will create a default discriminator map | |
* using the lower-case short name of each sub-class as the discriminator | |
* "type" name. This may be just fine for your purposes, but if not, | |
* this listener provides a way to programmatically inject your own | |
* discriminator map. | |
* | |
* To prevent Doctrine from creating the default discriminator map, you will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Doctrine\ORM\Query\Functions; | |
use Doctrine\ORM\Query\AST\Functions\FunctionNode; | |
use Doctrine\ORM\Query\Lexer; | |
use Doctrine\ORM\Query\Parser; | |
use Doctrine\ORM\Query\QueryException; | |
use Doctrine\ORM\Query\SqlWalker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Ant Javascript snippets | |
// | |
import(java.io.File); | |
importClass(Packages.org.apache.tools.ant.types.Environment); | |
importClass(Packages.org.apache.tools.ant.taskdefs.Echo); | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Very simple output colorizer. Only changes the foreground color. | |
* Tokens take the form {colorname}. | |
* | |
* Bright colors start with 'b', as in 'bgreen' and 'bblue'. | |
* | |
* You can escape brackets using double brackets {{ and }} | |
* | |
* PHP >= 5.3.0 (but could easily be modified to work with earlier versions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Creates a tree-structured array of directories and files from a given root folder. | |
* | |
* Gleaned from: http://stackoverflow.com/questions/952263/deep-recursive-array-of-directory-structure-in-php | |
* | |
* @param string $dir | |
* @param string $regex | |
* @param boolean $ignoreEmpty Do not add empty directories to the tree | |
* @return array |