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
[ | |
{ | |
"address": "0x4E84E9e5fb0A972628Cf4568c403167EF1D40431", | |
"symbol": "$FFC", | |
"decimal": 18, | |
"type": "default" | |
}, | |
{ | |
"address": "0xa024e8057eec474a9b2356833707dd0579e26ef3", | |
"symbol": "$FYX", |
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
func startDownload() { | |
let eoCategories = EONET.categories | |
let downloadedEvents = eoCategories.flatMap { categories in | |
return Observable.from(categories.map { category in | |
EONET.events(forLast: 360, category: category) | |
}) | |
} | |
.merge(maxConcurrent: 2) | |
let updatedCategories = eoCategories.flatMap { categories in |
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 requests | |
import sys | |
from bs4 import BeautifulSoup | |
from sys import stdin | |
# usage: | |
# echo 'https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/index.html' | python3 document_urls.py | |
# Use this script get link of pages for *one* apple programming guide document |
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 requests | |
import pdfkit | |
from bs4 import BeautifulSoup | |
url = 'https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/index.html' | |
pdfkit.from_url(url, 'out.pdf') |
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 Vapor | |
import Glibc | |
extension Droplet { | |
func setupRoutes() throws { | |
get("hello") { req in | |
var json = JSON() | |
try json.set("hello", "world") | |
return json | |
} |
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 java.io.*; | |
import java.math.BigInteger; | |
import java.security.SecureRandom; | |
/** | |
* Created by MainasuK on 2017-5-9. | |
*/ | |
public class RSA { | |
// public key |
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
TableView<T> tableView; | |
TableColumn<T, Boolean> booleanColumn; | |
private void setupTableView() { | |
tableView.setEditable(true); | |
} | |
private void setupTableViewColumn() { | |
booleanColumn.setCellFactory(column -> new CheckBoxTableCell<>()); | |
booleanColumn.setCellValueFactory(cellData -> { |
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
//: The up to date code snippet (Xcode 8 beta 6) for List which comforms Collection — *Advanced Swift* | |
import UIKit | |
private enum ListNode<Element> { | |
case end | |
indirect case node(Element, next: ListNode<Element>) | |
func cons(x: Element) -> ListNode<Element> { | |
return .node(x, next: self) |
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
// If you use self-size cell with stack view or Auto Layout. | |
// Try this to change row height with animation | |
// Assume you set the content heightConstraint which group in your stack view | |
// Or other heightConstraint to make your cell self-size | |
func changeRowHeight(in tableView: UITableView, at indexPath: IndexPath, with height: CGFloat) { | |
tableView.beginUpdates() | |
// Change your cell heightConstraint height |
NewerOlder