Skip to content

Instantly share code, notes, and snippets.

View kucheruk's full-sized avatar
😁
Hello!

Evgeniy Kucheruk kucheruk

😁
Hello!
  • ATI.su
  • Saint-Petersburg, Russia
View GitHub Profile
@kucheruk
kucheruk / addon.contentscript.js
Last active October 15, 2021 11:52
ATI.su morpheus gist.
//content script = ship, feature component = morpheus.
console.log("Morpheus injected");
const features = new Map();
function messageToMorpheus(msg) {
window.postMessage({ direction: "from-ship", message: msg }, "*");
}
chrome.runtime.onMessage.addListener((msg, _, sendResponse) => {
@kucheruk
kucheruk / BoardBot.js
Created September 12, 2018 08:04
review по запросу
1
@kucheruk
kucheruk / app.config
Last active January 25, 2017 13:26
Сериализируем сообщения из Akka.NET Cluster Sharding в Akka.Persistence.MongoDB #3
actor {
serializers {
akka-persistence-message = "Akka.Persistence.Serialization.MessageSerializer, Akka.Persistence"
akka-persistence-snapshot = "Akka.Persistence.Serialization.SnapshotSerializer, Akka.Persistence"
akka-singleton = "Akka.Cluster.Tools.Singleton.Serialization.ClusterSingletonMessageSerializer, Akka.Cluster.Tools"
akka-sharding = "Akka.Cluster.Sharding.Serialization.ClusterShardingMessageSerializer, Akka.Cluster.Sharding"
}
serialization-bindings {
"Akka.Persistence.Serialization.IMessage, Akka.Persistence" = akka-persistence-message
"Akka.Persistence.Serialization.Snapshot, Akka.Persistence" = akka-persistence-snapshot
@kucheruk
kucheruk / ClusterShardingMongoSerializer.cs
Last active January 25, 2017 13:42
Сериализируем сообщения из Akka.NET Cluster Sharding в Akka.Persistence.MongoDB #2
internal class ClusterShardingMongoSerializer : IBsonSerializer
{
private const string ManifestField = "manifest";
private const string BodyField = "body";
private readonly ClusterShardingMessageSerializer _serializer;
public ClusterShardingMongoSerializer(ExtendedActorSystem system)
{
_serializer = new ClusterShardingMessageSerializer(system);
}
@kucheruk
kucheruk / ClusterShardingPersistenseConfig.cs
Last active January 25, 2017 13:25
Сериализируем сообщения из Akka.NET Cluster Sharding в Akka.Persistence.MongoDB #1
internal class ClusterShardingPersistenseConfig
{
public static void Initialize(ActorSystem system)
{
MongoDbPersistence.Get(system);
var serializer = new ClusterShardingMongoSerializer(system as ExtendedActorSystem);
BsonClassMap.RegisterClassMap<JournalEntry>(e => {
e.AutoMap();
e.MapField(a => a.Payload).SetSerializer(serializer);
});
export function declination(number, titles) {
const cases = [2, 0, 1, 1, 1, 2];
return titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number % 10 < 5) ? number % 10 : 5]];
}
const SECOND = 1000;
const MINUTE = 60 * SECOND;
const HOUR = 60 * MINUTE;
const DAY = 24 * HOUR;
const WEEK = 7 * DAY;
@kucheruk
kucheruk / gist:dfd7b443ec6fd68f58f1
Created May 7, 2015 11:48
Subscrible Viewmodel
public abstract class BaseObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void Setter<T>(ref T setter, T newVal, Expression<Func<T>> property, params Expression<Func<object>>[] dependentProperties)
{
if (!equals(GetPropValue(property), newVal))
{
setter = newVal;
NotifyDependentProps(property, dependentProperties);

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

{
"title": "bubyanlogs",
"services": {
"query": {
"list": {
"0": {
"query": "@level=error",
"alias": "",
"color": "#BF1B00",
"id": 0,