This file contains hidden or 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
| const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
| function clickDownloadButton() { | |
| document.querySelector("span.export-pdf-modal button.wv-button--primary").click() | |
| } | |
| function clickExportButton() { | |
| document.querySelectorAll("span.export-pdf-modal button").item(2).click() | |
| } | |
| function openExportToPDFModal(r) { |
This file contains hidden or 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
| from django.template.defaulttags import TemplateIfParser | |
| from django import template | |
| register = template.Library() | |
| class IfElseAs(template.Node): | |
| def __init__(self, condition, if_var, else_var, var_name): | |
| self.condition = condition | |
| self.if_var = template.Variable(if_var) | |
| self.else_var = template.Variable(else_var) |
This file contains hidden or 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
| from datetime import timedelta | |
| import time | |
| from reactivex.notification import OnError | |
| from reactivex.testing import ReactiveTest, TestScheduler | |
| from reactivex.testing.subscription import Subscription | |
| from reactivex import operators | |
| import reactivex | |
| on_next = ReactiveTest.on_next | |
| on_error = ReactiveTest.on_error |
This file contains hidden or 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
| import random | |
| print random.pick([1,2,3]) |
This file contains hidden or 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 jasmineNG = {}; | |
| //set $q in your test | |
| jasmineNG.$q = null; | |
| //Could make similar to test a failing promise | |
| jasmineNG.createPromiseReturningSpy = function() { | |
| var deferred = jasmineNG.$q.defer(); | |
| // Use .andReturn to simply return a promise | |
| var spy = jasmine.createSpy().andReturn(deferred.promise); | |
| // Add resolve and reject functionalities | |
| spy.andResolveWith = function(val) { |
This file contains hidden or 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'; | |
| angular.module('assetsApp') | |
| .directive('localCss', function () { | |
| return { | |
| template: '', | |
| restrict: 'E', | |
| link: function (scope, element, attrs) { | |
| var style = document.createElement('link'); | |
| style.type = 'text/css'; |
This file contains hidden or 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'; | |
| angular.module('assetsApp') | |
| .directive('localCss', function () { | |
| return { | |
| template: '', | |
| restrict: 'E', | |
| link: function (scope, element, attrs) { | |
| var style = document.createElement('link'); | |
| style.type = 'text/css'; |
This file contains hidden or 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'; | |
| angular.module('assetsApp') | |
| .directive('localCss', function () { | |
| return { | |
| template: '', | |
| restrict: 'E', | |
| link: function (scope, element, attrs) { | |
| var style = document.createElement('link'); | |
| style.type = 'text/css'; |
This file contains hidden or 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'; | |
| angular.module('assetsApp') | |
| .directive('localCss', function () { | |
| return { | |
| template: '', | |
| restrict: 'E', | |
| link: function (scope, element, attrs) { | |
| var style = document.createElement('link'); | |
| style.type = 'text/css'; |
This file contains hidden or 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'; | |
| deferredApp.controller('MainCtrl', function ($scope, playerService, $timeout, $http, $q) { | |
| // For visualization purposes | |
| $scope.messages = []; | |
| var player, videoId; // initialize variables | |
| var ytQ = playerService.create("ytplayer"); // Returns a deferred object | |
| // Called when the ytQ deferred object is resolved |
NewerOlder