Skip to content

Instantly share code, notes, and snippets.

View shirmanov's full-sized avatar
💭
open to new opportunities

Leonid Shirmanov shirmanov

💭
open to new opportunities
  • RBI Group
  • SPb, Russia
  • 07:50 (UTC +03:00)
View GitHub Profile
public class MultiStream : Stream
{
private readonly List<Stream> _streams;
public MultiStream(params Stream[] streams)
{
_streams = streams.ToList();
}
public override void Flush()

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

@pedroraft
pedroraft / .env
Last active October 29, 2022 08:21
full graphql jwt auth example
JWT_SECRET=secret
@luizbafilho
luizbafilho / perf_overview.md
Last active September 18, 2019 12:55
Performance overview from K6

k6 performance overview

In order to get a general idea of how k6 is performing, and to see if there are any low-hanging fruit in terms of optimizations we could do, I did a series of tests running k6 against a local server, testing different changes to the k6 code base.

Local environment

macOS High Sierra 10.13.13
MacBook Pro(Retina, 15-inch, Mid 2014)
Processor: 2,2Ghz Intel Core i7
Memory: 16GB 1600MHz DDR3
@VesselinVassilev
VesselinVassilev / CrontabHelper.cs
Last active July 22, 2020 14:01
Custom Recurring Scheduled Tasks in Sitefinity with Cron Jobs
using NCrontab;
using System;
using Telerik.Sitefinity.Configuration;
using Telerik.Sitefinity.Services;
namespace SitefinityWebApp.Custom.Helpers
{
/// <summary>
/// Copied from the internal sitefinity classes
/// </summary>
<Query Kind="Program">
<Reference Relative="bin\Newtonsoft.Json.dll">D:\Data\LINQ\bin\Newtonsoft.Json.dll</Reference>
</Query>
void Main()
{
// -------------------------
// To use this application you must download a copy of Newtonsoft.Json.dll, which by default is not bundled with LINQPad.
// This DLL can be sourced from the NuGet package manager here: https://www.nuget.org/packages/Newtonsoft.Json
// Note the hardcoded path above, this can be changed to the location of the DLL on your hard drive.
@miguelmota
miguelmota / ssm_parameter.go
Last active September 26, 2023 10:36
AWS SSM Go SDK parameter store example
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
)
@wcharczuk
wcharczuk / etcd.service
Created February 20, 2018 04:28
Local Ubuntu etcd systemd service
[Unit]
Description=etcd
Documentation=https://github.com/coreos/etcd
Conflicts=etcd.service
Conflicts=etcd2.service
[Service]
Type=notify
Restart=always
RestartSec=5s
@berkayunal
berkayunal / ._ Loading variables from .env files in Ansible.md
Created January 16, 2018 20:42
Loading variables from .env files in Ansible

Loading variables from .env files in Ansible

Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn't seem to have a lookup for .env files, as used in Laravel projects, also available for PHP, Ruby, Node.js, Python and others.

One option is to launch Ansible with the Ruby dotenv command line script... But that requires Ruby, which seems like overkill to me.

So here is a simpler solution that I use. It consists of:

  1. The .env file itself
  2. A small shell script that loads the .env file into environment variables - ansible-playbook.sh
@isaacplmann
isaacplmann / table-of-contents.md
Last active September 17, 2024 05:20
Advanced Angular Patterns