This file contains hidden or 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
var CSRF = (function() { | |
window.addEvent('domready', function() { | |
/** | |
* Setup triggers on the .submit() function and the `submit` event so we | |
* can add csrf inputs immediately before the form is submitted. | |
*/ | |
$$('form').each(function(form) { | |
// Ensure all forms submitted via a traditional 'submit' button have | |
// an up-to-date CSRF input | |
form.addEvent('submit', function() { |
This file contains hidden or 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
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
This file contains hidden or 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 | |
/** | |
* Prints a string showing current time zone offset to UTC, considering daylight savings time. | |
* @link http://php.net/manual/en/timezones.php | |
* @param string $time_zone Time zone name | |
* @return string Offset in hours, prepended by +/- | |
*/ | |
function ch150918__utc_offset_dst( $time_zone = 'Europe/Berlin' ) { | |
// Set UTC as default time zone. |