I wrote this four years ago, so instead use this command:
$ docker rmi $(docker images -q -f dangling=true)
| using Autofac; | |
| using FluentValidation; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace WebSite | |
| { |
| using System; | |
| using Autofac; | |
| using FluentValidation; | |
| namespace Sample.Web.Infrastructure | |
| { | |
| public class AutofacValidatorFactory : ValidatorFactoryBase | |
| { | |
| private readonly IComponentContext _context; |
| using System.IO; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Serilog; | |
| using Serilog.Extras.Topshelf; | |
| using Topshelf; | |
| using Topshelf.Logging; | |
| namespace ConsoleApplication1 | |
| { |
Microsoft’s navigator.msLaunchUri method only works in Internet Explorer on Windows 8. Therefore I came up with a (nearly) cross-browser implementation that uses the native msLaunchUri when it’s available and falls back to adventurous hacks when running in other browsers.
launchUri (uri, successCallback, noHandlerCallback, unknownCallback)
| # Props to qmx and abstractj for the inspiration | |
| # | |
| # Put this file in your home directory and these lines to .profile | |
| # if [[ -f "$HOME/.java.env" ]]; then | |
| # source "$HOME/.java.env"; | |
| # fi | |
| VERSION=$1 | |
| if [ ! -n "$VERSION" ] |
| //Retry http with a back off on failure | |
| await Policy.Handle<HttpRequestException>().WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))) | |
| .ExecuteAsync(async () => | |
| { | |
| var result = await httpClient.GetAsync("api/CallToServer/" + varibleToSendToServer, cancellationToken); | |
| if (result.IsSuccessStatusCode) | |
| { | |
| returnValue = await result.Content.ReadAsAsync<List<Results>>(token); | |
| } |
<!- .... ->
<log4net>
<appender name="RollingLogFileAppenderLogstash" type="log4net.Appender.RollingFileAppender">
<encoding value="utf-8" />
<!--该目录必需有 IIS用户 写权限-->
<file value="X:/var/log/[app_name]/logfile.log" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />nssm.exe install SERVICE_NAME "C:\path\to\exe\or\bat\file.ext" "argument1 argument2"
| function Unzip($zipfile, $outdir) | |
| { | |
| Add-Type -AssemblyName System.IO.Compression.FileSystem | |
| $archive = [System.IO.Compression.ZipFile]::OpenRead($zipfile) | |
| foreach ($entry in $archive.Entries) | |
| { | |
| $entryTargetFilePath = [System.IO.Path]::Combine($outdir, $entry.FullName) | |
| $entryDir = [System.IO.Path]::GetDirectoryName($entryTargetFilePath) | |
| #Ensure the directory of the archive entry exists |