See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.json
file in/etc/docker
:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
// usage: @time | |
function time(target: any, context: ClassMethodDecoratorContext): any { | |
const originalMethod = target; | |
const resultMethod = async function (this: any, ...arg: any[]) { | |
const start = performance.now(); | |
try { | |
return await originalMethod.apply(this, arg); | |
} catch (error) { |
// usage: @retry({ maxRetryAttempts: 10, delay: 500}) | |
type RetryOptions = { | |
maxRetryAttempts: number, | |
delay: number | |
} | |
function retry(retryOptions: RetryOptions) { | |
return function (target: any, context: any) { | |
console.log("Applying retry decorator"); |
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json
file in /etc/docker
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
set easymotion | |
set relativenumber | |
set number | |
set clipboard+=unnamedplus | |
set ignorecase | |
set surround | |
set ideajoin | |
sethandler <C-U> n-v:vim i:ide | |
sethandler <C-K> n:vim i-v:ide | |
sethandler <C-D> n:vim i-v:ide |
[user] | |
name = Gab Soulavy | |
email = [email protected] | |
signingKey = xxx | |
[core] | |
autocrlf = input | |
fileMode = false | |
[alias] | |
last = log -1 HEAD | |
alias = config --get-regexp ^alias\\. |
public abstract class MockLogger<T> : ILogger<T> | |
{ | |
void ILogger.Log<TState>( | |
LogLevel logLevel, | |
EventId eventId, | |
TState state, | |
Exception exception, | |
Func<TState, Exception, string> formatter) | |
=> Log(logLevel, formatter(state, exception)); |
using ICSharpCode.SharpZipLib.Zip | |
using ICSharpCode.SharpZipLib.Zip.Compression | |
using ICSharpCode.SharpZipLib.Zip.Compression.Streams | |
using System.Threading.Tasks | |
public class CompressUtil | |
{ | |
public static async Task<byte[]> DecompressData(byte[] bytes) | |
{ | |
using var stream = new InflaterInputStream(new MemoryStream(bytes)); |
public static class Lz77 | |
{ | |
private const int RingBufferSize = 4096; | |
private const int UpperMatchLength = 18; | |
private const int LowerMatchLength = 2; | |
private const int None = RingBufferSize; | |
private static readonly int[] Parent = new int[RingBufferSize + 1]; | |
private static readonly int[] LeftChild = new int[RingBufferSize + 1]; | |
private static readonly int[] RightChild = new int[RingBufferSize + 257]; | |
private static readonly ushort[] Buffer = new ushort[RingBufferSize + UpperMatchLength - 1]; |
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "chrome", | |
"request": "launch", | |
"name": "Debug", |
public class Program | |
{ | |
private string lastPropertyToChange; | |
void Main() | |
{ | |
var model = new AutoNotifyPropertyChangedProxyCreator().Create<Person>(); | |
model.PropertyChanged += (o, e) => lastPropertyToChange = e.PropertyName; | |
model.Name = "Harold"; | |
model.Name = "James"; |