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> | |
| let tabs = ["one", "two", "three"] | |
| let selected = tabs[0] | |
| </script> | |
| //your links | |
| <li on:click={()=>selected = tabs[0]} class:selected={selected==="one"}> | |
| <li on:click={()=>selected = tabs[1]} class:selected {selected==="two"}> | |
| <li on:click={()=>selected = tabs[2]} class:selected={selected==="three"}> |
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
| // | |
| // UIFont.swift | |
| // wodpod | |
| // | |
| // Created by BMGH SRL on 22/05/2017. | |
| // Copyright © 2017 WodPod. All rights reserved. | |
| // | |
| import UIKit |
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
| // | |
| // NibView.swift | |
| // wodpod | |
| // | |
| // Created by BMGH SRL on 10/11/2018. | |
| // Copyright © 2018 WodPod. All rights reserved. | |
| // | |
| import UIKit |
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 | |
| extension FileManager { | |
| func urls(for directory: FileManager.SearchPathDirectory, skipsHiddenFiles: Bool = true ) -> [URL]? { | |
| let documentsURL = urls(for: directory, in: .userDomainMask)[0] | |
| let fileURLs = try? contentsOfDirectory(at: documentsURL, includingPropertiesForKeys: nil, options: skipsHiddenFiles ? .skipsHiddenFiles : [] ) | |
| return fileURLs | |
| } | |
| } |
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
| let connectionValue = ConnectionValues(rawValue: expert.connectionStatus.isBeingFollowed) | |
| switch connectionValue { | |
| case .some(.NONE), .none: | |
| header.currentButtonState = .follow | |
| header.setButtonState(forButton: header.followButton, state: .follow) | |
| case .some(.ACCEPTED): | |
| header.currentButtonState = .following | |
| header.setButtonState(forButton: header.followButton, state: .following) |
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
| // | |
| // UPCarouselLayout.swift | |
| // SopraSteria | |
| // | |
| // Created by BMGH SRL on 16/05/2018. | |
| // Copyright © 2018 BMAGH. All rights reserved. | |
| // | |
| import UIKit |
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 UIImageView { | |
| func load(url: URL) { | |
| DispatchQueue.global().async { [weak self] in | |
| if let data = try? Data(contentsOf: url) { | |
| if let image = UIImage(data: data) { | |
| DispatchQueue.main.async { | |
| self?.image = image | |
| } | |
| } | |
| } |
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
| protocol Executable { | |
| func execute() -> Self | |
| } | |
| // Generic function with unconstrained generic type | |
| func serve<T> (_ element: T) -> T { | |
| return element | |
| } | |
| // Heterogenous (Existential Types) |
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 link = document.createElement('link'); | |
| link.href = chrome.extension.getURL('main.css'); | |
| link.rel = 'stylesheet'; | |
| document.documentElement.insertBefore(link); | |
| var customStyles = document.createElement('style'); | |
| customStyles.appendChild(document.createTextNode( | |
| 'body { .cur-main-header-container, .cur-page-footer, .cur-schedule-details-button { display: none; }}' | |
| )); |
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
| //---- Appened STYLE | |
| //document.getElementsByTagName('html')[0].innerHTML+='<style>*{color:#fff}</style>' | |
| StringBuilder extraStyles = new StringBuilder(); | |
| extraStyles.append("javascript:(function extra(){"); | |
| if(getResources().getBoolean(R.bool.extraCss)){ | |
| extraStyles.append( | |
| "var aa =document.createElement(\"link\");" + | |
| "aa.type='text/css'; aa.rel='stylesheet'; "+ | |
| "aa.href='"+getResources().getString(R.string.extraCssUrl)+"';"+ | |
| "document.getElementsByTagName(\"head\")[0].appendChild(aa);" |
NewerOlder