国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| using System; | |
| using System.Threading.Tasks; | |
| using Akka.Actor; | |
| using Akka.Configuration; | |
| namespace AkkaDemos | |
| { | |
| public interface IGreeter | |
| { | |
| Task<string> Greet(IGreeter who); |
| # ========================================================== | |
| # NPM | |
| # ========================================================== | |
| npm set registry https://registry.npmmirror.com # 注册模块镜像 | |
| npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像 | |
| ## 以下选择添加 | |
| npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像 | |
| npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像 |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Http; | |
| using TodoApi.Services; | |
| namespace TodoApi.Middlewares | |
| { | |
| public class AuthzMiddleware | |
| { | |
| private readonly RequestDelegate _next; |
| using Akka.Streams; | |
| using Akka.Streams.Stage; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Demo | |
| { | |
| sealed class PreFetch<T> : GraphStage<SourceShape<T>> |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| public class UploadUtilityHelper | |
| { | |
| private readonly string bucketName = ConfigurationManager.AppSettings["BucketName"]; | |
| private static readonly RegionEndpoint bucketRegion = RegionEndpoint.USEast1; | |
| public string UploadChunk(string fileName, string uploadId, int chunkIndex, int chunkMax, Stream stream, string prevETags) | |
| { | |
| var response = ""; | |
| try |
| ------------------------------------------------------------------------------------------------------------------------------ | |
| -- Module: utf8_filenames | |
| ------------------------------------------------------------------------------------------------------------------------------ | |
| -- Filename: utf8_filenames.lua | |
| -- Version: 2019-07-13 | |
| -- License: MIT (see at the end of this file) | |
| -- This module modifies standard Lua functions so that they work with UTF-8 filenames on Windows: | |
| -- io.open | |
| -- io.popen |
| #!/bin/sh | |
| # | |
| # An example hook script to verify what is about to be committed. | |
| # Called by "git commit" with no arguments. The hook should | |
| # exit with non-zero status after issuing an appropriate message if | |
| # it wants to stop the commit. | |
| # | |
| # To enable this hook, rename this file to "pre-commit". | |
| # Redirect output to stderr. |
| SWAGGER_SETTINGS = { | |
| 'SECURITY_DEFINITIONS': { | |
| 'api_key': { | |
| 'type': 'apiKey', | |
| 'in': 'header', | |
| 'name': 'Authorization' | |
| } | |
| }, | |
| 'CUSTOM_HEADERS': { | |
| 'HTTP_AUTHORIZATION': 'Token a476957f3c20a3a262a760fc2194569315ea5670' |
| using Newtonsoft.Json; | |
| public static string JsonPrettify(string json) | |
| { | |
| using (var stringReader = new StringReader(json)) | |
| using (var stringWriter = new StringWriter()) | |
| { | |
| var jsonReader = new JsonTextReader(stringReader); | |
| var jsonWriter = new JsonTextWriter(stringWriter) { Formatting = Formatting.Indented }; | |
| jsonWriter.WriteToken(jsonReader); |