- https://stackoverflow.com/questions/54966200/does-swift-have-standard-scope-functions-like-in-kotlin
extension Optional {
func `let`(do: (Wrapped)->()) {
guard let v = self else { return }| interface BaseContract { | |
| showProgress() | |
| hideProgress() | |
| } | |
| interface Contract extends BaseContract { | |
| interface View { |
extension Optional {
func `let`(do: (Wrapped)->()) {
guard let v = self else { return }| package com.company.project.components; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.context.MessageSource; | |
| import org.springframework.context.support.MessageSourceAccessor; | |
| import org.springframework.stereotype.Component; | |
| import javax.annotation.PostConstruct; | |
| import java.util.Locale; |
| # https://stackoverflow.com/questions/19875218/best-way-to-format-large-json-file-30-mb | |
| cat ugly.json | python -mjson.tool > pretty.json |
| #!/bin/python | |
| # References: | |
| # https://stackoverflow.com/a/15502713/6846888 | |
| # http://python-notes.curiousefficiency.org/en/latest/python3/text_file_processing.html | |
| import os | |
| import sys | |
| path = os.path.dirname(__file__) |
| docker container run -it debian bash |
| import requests | |
| #http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file | |
| url = "http://localhost:5000/" | |
| fin = open('simple_table.pdf', 'rb') | |
| files = {'file': fin} | |
| try: | |
| r = requests.post(url, files=files) | |
| print r.text |
| is there any way to pass cors policy: | |
| https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9 | |
| https://joke-api-strict-cors.appspot.com/random_joke | |
| https://github.com/Rob--W/cors-anywhere | |
| https://github.com/Rob--W/cors-anywhere/issues/39 | |
| https://cors-anywhere.herokuapp.com/ |