Skip to content

Instantly share code, notes, and snippets.

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 ];
_.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];
})
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';
<% if(depth){ %>
<div class='fib-box' data-depth='<%= depth %>' style='width: <%= val %>px; height: <%= val %>px;'></div>
<% print(template(getFibObj(depth-1))) %>
<% } %>
var Language = Backbone.Model.extend({
defaults: function() {
return {
languageName: "",
};
},
initialize: function() {
},
save: function() {
var Language = Backbone.Model.extend({
defaults: function() {
return {
languageName: "",
};
},
initialize: function() {
},
url: "echoBackbone.php",
var collection = [];
model.collection.each( function(e, i, l){
collection.push( e.toJSON() );
});
params.data = JSON.stringify(collection);
#!/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;
<?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()) {
<?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');