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
<?xml version="1.0" encoding="UTF-8"?> | |
<VAST version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd"> | |
<Ad id="1"> | |
<Wrapper> | |
<AdSystem>xx</AdSystem> | |
<VASTAdTagURI> | |
<![CDATA[https://pubads.g.doubleclick.net/gampad/ads?sz=450x400...]]> | |
</VASTAdTagURI> | |
<Extensions> | |
<Extension type="waterfall" fallback_index="0" /> |
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
#!/bin/bash | |
function init() { | |
touch result.txt | |
grep "tracker.gif" iis.log > tracker.log | |
} | |
function createTitle() { | |
echo " " >> result.txt | |
echo "==============================" >> result.txt |
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 asyncify(f) { | |
return function _asyncify() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
var argsWithoutLast = args.slice(0, -1); | |
var callback = args[args.length - 1]; | |
var result, error; | |
try { | |
result = f.apply(this, argsWithoutLast); | |
} catch (e) { |
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
it('should simulate promise', inject(function($q, $rootScope) { | |
var deferred = $q.defer(); | |
var promise = deferred.promise; | |
var resolvedValue; | |
promise.then(function(value) { resolvedValue = value; }); | |
expect(resolvedValue).toBeUndefined(); | |
// Simulate resolving of promise | |
deferred.resolve(123); |
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
angular.module('breakmeApp') | |
.controller('MainCtrl', function($scope, searchService) { | |
searchService.search($scope.query) | |
.then(function(data) { | |
// This is set when the promise is resolved. | |
$scope.results = data; | |
}) | |
.catch(function() { | |
// This is set in the event of an error. | |
$scope.error = 'There has been an error!'; |
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 data = [{ | |
isActive: "1", | |
logins: 2000, | |
clicks: 1000 | |
}, { | |
isActive: "1", | |
logins: 3000, | |
clicks: 1000 | |
}, { | |
isActive: "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 once(fn) { | |
var returnValue, called = false; | |
return function () { | |
if (!called) { | |
called = true; | |
returnValue = fn.apply(this, arguments); | |
} | |
return returnValue; | |
}; | |
} |
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
'use strict'; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' | |
module.exports = function (grunt) { |
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 node(head, tail) { | |
return [head, tail]; | |
}; | |
function head(stream) { | |
return stream[0]; | |
}; | |
function tail(stream) { | |
var tail = stream[stream.length - 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 target = { | |
prop1: "123", | |
prop2: "456", | |
prop3: { | |
A: "1", | |
B: "2" | |
} | |
}; | |
var schema = [ |