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
!(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
// 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
<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
<!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
<!doctype html> | |
{% block html_tag -%} | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{% block lang 'en' %}"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="{{ block('lang') }}"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="{{ block('lang') }}"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ block('lang') }}"> <!--<![endif]--> | |
{%- endblock %} | |
<head> | |
<meta charset="{% block charset 'utf-8' %}"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
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 | |
/** | |
* Resolves a path just like realpath(), except the file or directory does not have to exist. | |
* | |
* Works for Unix-based and Windows systems. | |
* | |
* @param string $path | |
* @param string $ds This is only here to make testing easier. | |
* | |
* @return string |
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 | |
use Psr\EventDispatcher\EventDispatcherInterface; | |
use Symfony\Component\HttpFoundation as Http; | |
/** | |
* HttpKernel: "Get the response, and get out." | |
* | |
* As soon as the kernel gets its hands on a Response object, it says "I'm done" and returns it. | |
* It is only interested in finding a Response object, at which point it will call it a day. |
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
Ember.Object.keys = function (obj) { | |
if (!(obj instanceof Ember.Object)) { | |
return Object.keys(obj); | |
} | |
if (obj instanceof DS.Model) { | |
return Object.keys(obj.toJSON()); | |
} | |
let constructor = obj.constructor, | |
objectKeys = [], | |
rx = /^[a-z][a-z0-9_]*$/i; |
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 | |
// | |
// Symfony Bare | |
// | |
// php -S localhost:8181 symfony-bare.php | |
// | |
// http://localhost:8181/is-leap-year | |
// | |
require_once 'vendor/autoload.php'; |