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 DataBindConvention = { | |
selector: "*[data-bind]", | |
handler: { | |
bind: function(selector, view, model){ | |
view.$(selector).each(function(index){ | |
var element = view.$(this); | |
var databind = element.attr("data-bind").split(" "); | |
var elementAttr = databind[0]; | |
var modelAttr = databind[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
loadFromUrl = function (params, callback) { | |
'use strict'; | |
var onError = function (err) { | |
callback(err, null); | |
}; | |
params.newFileName = params.newFileName || params.urlPath.substr(params.urlPath.lastIndexOf('/') + 1); | |
params.expansion = params.expansion || ''; | |
params.mimeType = params.mimeType || 'text/plain'; | |
requestFileSystem(window.LocalFileSystem.PERSISTENT, 0, function (fileSystem) { | |
fileSystem.root.getDirectory("folder", {"create": true, "exclusive": false}, 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
{ SourceFile: '/var/tmp/google-drive-metadater/081612INDIANMARKET_3.JPG', | |
ExifToolVersion: 9.69, | |
FileName: '081612INDIANMARKET_3.JPG', | |
Directory: '/var/tmp/google-drive-metadater', | |
FileSize: '5.5 MB', | |
FileModifyDate: '2015:07:02 14:06:06+00:00', | |
FileAccessDate: '2015:07:02 14:06:07+00:00', | |
FileInodeChangeDate: '2015:07:02 14:06:06+00:00', | |
FilePermissions: 'rw-r--r--', | |
FileType: 'JPEG', |
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
{ '0': | |
{ googleId: '0B6eH53DJsjPwcGRRaUdERi1TU0k', | |
metadata: | |
{ SourceFile: '/var/tmp/google-drive-metadater/081612INDIANMARKET_3.JPG', | |
ExifToolVersion: 9.69, | |
FileName: '081612INDIANMARKET_3.JPG', | |
FileSize: '5.5 MB', | |
FileModifyDate: '2015:07:02 14:06:06+00:00', | |
FileAccessDate: '2015:07:02 14:06:07+00:00', | |
FileType: 'JPEG', |
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
define(['backbone', | |
'controller' | |
],function( | |
Backbone, | |
live){ | |
return function(){ | |
var previousRoute = null; | |
var rootVisited = false; |
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
TCP_IP. Сетевое администрирование, 3-е издание -- это супер базовое, наверное все уже читали | |
У. Р. Стивенс - UNIX. Разработка сетевых приложений |
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> | |
<html> | |
<head> | |
</head> | |
<body> | |
<script> | |
var wrk = new Worker('./w.js'); |
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 startErrorTracking = function(){ | |
window.addEventListener('error', function (err) { | |
var lineAndColumnInfo = err.colno ? ' line:' + err.lineno +', column:'+ err.colno : ' line:' + err.lineno; | |
push.call(this, 'FrontendError', | |
err.message, | |
err.filename + lineAndColumnInfo + ' -> ' + navigator.userAgent); | |
}); | |
}; |
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
describe("spec", function () { | |
var server, fakeData = [ {a:1}, {b:2}, {c:3} ]; | |
before(function () { | |
server = sinon.fakeServer.create(); | |
server.respondWith( | |
"GET", | |
"https://myhost.local/url/5", | |
[200, { "Content-Type": "application/json" }, JSON.stringify(fakeData)] | |
); |
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 MakeQuerablePromise(promise) { | |
// Don't create a wrapper for promises that can already be queried. | |
if (promise.isResolved) return promise; | |
var isResolved = false; | |
var isRejected = false; | |
// Observe the promise, saving the fulfillment in a closure scope. | |
var result = promise.then( | |
function(v) { isResolved = true; return v; }, |
OlderNewer