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
| /* | |
| Running Variants locally without the editor | |
| Authored by Richard Cowin | |
| Disable content security policy with Resource Override | |
| This will allow for local host | |
| window.applyVariants(‘http://localhost:8000/t-and-c/’, [‘v1’]); | |
| */ | |
| window.applyVariants = function applyVariants(folder, variants, poll) { |
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
| function sendEvent(tag, url){ | |
| try { | |
| window.evolv.client.emit(tag); | |
| } catch (e) { | |
| console.log(e); | |
| } | |
| } | |
| function pageMatch(page) { |
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
| module.exports = function () { | |
| var section = $('.warranty-cta'); | |
| if (section) { | |
| evolv.context.update({ service_section: "true" }); | |
| }; | |
| }; |
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
| module.exports = function () { | |
| var Evolv=function(t){"use strict";var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,i)};function i(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){function t(t){void 0===t&&(t=5e3),this.maxWaitTime=t,this.queue=[],this.interval=50,this.activeCandidateEvents={confirmed:{},contaminated:{}},this.contaminations={},this.waitForAnalytics(),this.waitForEvolv(this.configureListeners.bind(this))}return t.prototype.configureListeners=function(){var t=this;window.evolv.client.on("confirmed",(function(e){t.sendMetricsForActiveCandidates(e)})),window.evolv.client.on("contaminated",(function(e){t.sendMetricsForActiveCandidates(e)})),window.evolv.client.on("event.emitted",(function(e,i){t.sendMetrics(i,{uid:window.evolv.context.uid})}))},t.prototype.sendMetricsForActiveCandidates=f |
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
| module.exports = function() { | |
| var url = window.location.href; | |
| var nodes = document.querySelectorAll('[href^="tel"]'); | |
| var callBtns = Array.prototype.slice.call(nodes); | |
| callBtns.forEach(function(btn) { | |
| btn.addEventListener('click', function() { | |
| evolv.client.emit('tap_to_call.clicked'); | |
| }) | |
| }) |
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
| module.exports = function() { | |
| var authenticated = window.localStorage.getItem('auth_token'); | |
| if (authenticated){ | |
| evolv.context.update({'auth':'true'}) | |
| } else { | |
| evolv.context.update({'auth':'false'}) | |
| } | |
| }; |
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
| public func get<T>(key: String, defaultValue: T) -> Any { | |
| let group = DispatchGroup() | |
| var allocations = [JSON]() | |
| var value = [JSON]() | |
| if (futureAllocations == nil) { return defaultValue } | |
| // This needs to be a blocking operation | |
| let _ = self.futureAllocations?.done { (jsonArray) in | |
| allocations = jsonArray |
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 Foundation | |
| public class LRUCache<KeyType: Hashable> { | |
| private let maxSize: Int | |
| private var cache: [KeyType: Any] = [:] | |
| private var priority: LinkedList<KeyType> = LinkedList<KeyType>() | |
| private var key2node: [KeyType: LinkedList<KeyType>.LinkedListNode<KeyType>] = [:] | |
| public init(_ maxSize: Int) { | |
| self.maxSize = maxSize |
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
| <script> | |
| // app ID | |
| var intercomSettings = { | |
| app_id: "r0j5pbsv" | |
| }; | |
| // Verifies and cleans all GTM variables | |
| function pushGTMVariablesToIntercom(gtmKey, gtmValue) { | |
| if(gtmValue != null && gtmValue != "" && gtmValue != "undefined") { | |
| if(typeof gtmValue == "string") { |
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
| extension ShopsViewController: UITableViewDelegate { | |
| func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
| let selectedShop = fetchedResultsController.object(at: indexPath) | |
| let st = UIStoryboardname: "Main", bundle: Bundle.main) | |
| let vc = st.instantiateViewController(withIdentifier: "EmployeeViewController") as! EmployeeViewController | |
| vc.shop = selectedShop | |
| self.navigationController?.pushViewController(vc, animated: true) | |
| } |
NewerOlder