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
// Some versions to test [v1, v2, expected result] | |
var versions = [ | |
['1.2.0', '1.2', 0], | |
['1.4', '1.7.2', 1], | |
['1.2pre', '1.2', 1], | |
['1.7', '1.1.1', -1], | |
['1.7.9RC1', '1.7.9RC2', 1], | |
['1.7.9RC1', '1.7.9RC', -1], | |
['1.7.9RC1', '1.7.9', 1], | |
['0.4beta', '0.4', 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
function getVendorPropertyName(prop) { | |
// Handle unprefixed versions (FF16+, for example) | |
if (prop in div.style) return prop; | |
var prefixes = ['Moz', 'Webkit', 'O', 'ms']; | |
var prop_ = prop.charAt(0).toUpperCase() + prop.substr(1); | |
for (var i=0; i<prefixes.length; ++i) { | |
var vendorProp = prefixes[i] + prop_; | |
if (vendorProp in div.style) { return vendorProp; } |
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
// UMD dance - https://github.com/umdjs/umd | |
!function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery'], factory); | |
} else { | |
factory(root.jQuery); | |
} | |
}(this, function($) { | |
'use strict'; |
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
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
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 | |
$fileName = $_FILES['afile']['name']; | |
$fileType = $_FILES['afile']['type']; | |
$fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
$json = json_encode(array( | |
'name' => $fileName, | |
'type' => $fileType, | |
'dataUrl' => $dataUrl, |
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
/** | |
* @ NAME: Cross-browser TextStorage | |
* @ DESC: text storage solution for your pages | |
* @ COPY: sofish, http://sofish.de | |
*/ | |
typeof window.localStorage == 'undefined' && ~function () { | |
var localStorage = window.localStorage = {}, | |
prefix = 'data-userdata', | |
doc = document, |
NewerOlder