国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| import SwiftUI | |
| import WebKit | |
| enum WebViewError: Error { | |
| case contentConversion(String) | |
| case emptyFileName | |
| case inivalidFilePath | |
| var message: String { | |
| switch self { |
| defmodule Downloader do | |
| @moduledoc""" | |
| Download streams of bytes from URLs. | |
| Useful to transfer large files with low RAM usage. | |
| ## Example with `ExAWS.S3.upload/3` | |
| ```elixir | |
| url | |
| |> Downloader.stream_body!() |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| module.exports = { | |
| h5: { | |
| miniCssExtractPluginOption: { | |
| filename: 'css/[name].[hash].css', | |
| chunkFilename: 'css/[id].[chunkhash].css' | |
| }, | |
| enableDll: false, | |
| webpackChain(chain, webpack) { | |
| const hashRule = (type) => { | |
| chain.module.rules.get(type).uses.get("urlLoader").get("options").name = |
| import JavaScriptCore | |
| extension JSContext { | |
| subscript(key: String) -> Any { | |
| get { | |
| return self.objectForKeyedSubscript(key) as Any | |
| } | |
| set{ | |
| self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
| } |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/ | |
| from lxml import html | |
| from json import dump,loads | |
| from requests import get | |
| import json | |
| from re import sub | |
| from dateutil import parser as dateparser | |
| from time import sleep |
This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.
For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai
| extension CGImage { | |
| var isDark: Bool { | |
| get { | |
| guard let imageData = self.dataProvider?.data else { return false } | |
| guard let ptr = CFDataGetBytePtr(imageData) else { return false } | |
| let length = CFDataGetLength(imageData) | |
| let threshold = Int(Double(self.width * self.height) * 0.45) | |
| var darkPixels = 0 | |
| for i in stride(from: 0, to: length, by: 4) { | |
| let r = ptr[i] |
| Settings on Twidere: | |
| API URL Format: https://your-host/[DOMAIN.]twitter.com/ | |
| Uncheck "Same OAuth signing URL" | |
| Uncheck "No verion suffix" | |
| Password login recommended. |