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
var progressElements = { }; | |
$(document).ready( function(){ | |
$("#fileUploads").fileupload({ | |
dataType: 'json', | |
done: function(e, data){ | |
var fileName = data.files[0].name; | |
var el = progressElements[ data.files[0].name ]; |
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
_.template = function(text, data, settings) { | |
settings = _.defaults(settings || {}, _.templateSettings); | |
// Compile the template source, taking care to escape characters that | |
// cannot be included in a string literal and then unescape them in code | |
// blocks. | |
var source = "__p+='" + text | |
.replace(escaper, function(match) { | |
return '\\' + escapes[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
var __p = ''; | |
var print = function () { | |
__p += Array.prototype.join.call(arguments, '') | |
}; | |
with(obj || {}) { | |
__p += '\n'; | |
if (depth) {; | |
__p += '\n<div class=\'fib-box\' data-depth=\'' + (depth) + '\' style=\'width: ' + (val) + 'px; height: ' + (val) + 'px;\'></div>\n'; | |
print(template(getFibObj(depth - 1))); | |
__p += '\n'; |
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
<% if(depth){ %> | |
<div class='fib-box' data-depth='<%= depth %>' style='width: <%= val %>px; height: <%= val %>px;'></div> | |
<% print(template(getFibObj(depth-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
var Language = Backbone.Model.extend({ | |
defaults: function() { | |
return { | |
languageName: "", | |
}; | |
}, | |
initialize: function() { | |
}, | |
save: function() { |
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
var Language = Backbone.Model.extend({ | |
defaults: function() { | |
return { | |
languageName: "", | |
}; | |
}, | |
initialize: function() { | |
}, | |
url: "echoBackbone.php", |
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
var collection = []; | |
model.collection.each( function(e, i, l){ | |
collection.push( e.toJSON() ); | |
}); | |
params.data = JSON.stringify(collection); |
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
#!/usr/bin/php | |
<?php | |
require_once 'config.php'; | |
require_once('MimeMailParser/MimeMailParser.class.php'); | |
$total = ""; | |
$stdin = fopen('php://stdin', 'r'); | |
while (($buffer = fgets($stdin)) !== false) { | |
$total .= $buffer; |
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 | |
public function getAllErrors($children, $template = true) { | |
$this->getAllFormErrors($children); | |
return $this->allErrors; | |
} | |
private function getAllFormErrors($children, $template = true) { | |
foreach ($children as $child) { | |
if ($child->hasErrors()) { |
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 | |
foreach($form->getErrors() as $e) | |
$errors[]=$translator->trans($this->convertFormErrorObjToString($e), array(), 'validators'); | |
foreach($this->getAllErrors($children) as $key=>$error) | |
$errors[]=$key.': '.$translator->trans($error[0], array(), 'validators'); |