Skip to content

Instantly share code, notes, and snippets.

View Aetherus's full-sized avatar
💭
zzz

aetherus Aetherus

💭
zzz
View GitHub Profile
@Aetherus
Aetherus / scale-out-phoenix-with-websocket.md
Last active February 23, 2024 14:31
How to scale out a Phoenix application with websocket

How to scale out a Phoenix application with websocket

Foreword

It's relatively easy to scale out stateless web applications. You often only need a reverse proxy. But for those stateful web applications, especially those applications that embeds websocket services in them, it's always a pain to distribute them in a cluster. The traditional way is introducing some external services like Redis to handle pubsub, however, in such way, you often need to change your code. Can Erlang/Elixir, the "concurrency oriented programming languages", best other languages in this use case? Has Phoenix framework already integrated the solution of horizontally scaling websocket? I'll do an experiment to prove (or disprove) that.

Resources

@Aetherus
Aetherus / valkyrie_profile_leveling.ex
Last active February 22, 2023 09:00
Valkyrie Profile Max Stats Leveling in the Second Room of Seraphic Gate
defmodule ValkyrieProfile.Leveling do
@enemies %{
left: 7000,
right: 10500,
up: 35000
}
@equipment_boosts %{
[] => 1.0,
[:ring] => 1.3,
@Aetherus
Aetherus / init.vim
Created January 17, 2022 09:24
Vimrc
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter'
Plug 'ervandew/supertab'
Plug 'elixir-lang/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'Xuyuanp/nerdtree-git-plugin'
@Aetherus
Aetherus / nvidia-elementaryos-loki.md
Created September 28, 2019 05:51 — forked from Jiab77/nvidia-elementaryos-loki.md
nVidia drivers installation on ElementaryOS - Loki (ubuntu 16.04 based distrib)

nVidia drivers installation on ElementaryOS - Loki

Introduction

ElementaryOS - Loki is an amazing ubuntu based distribution, I've just felt in love on it BUT they've removed what's required to install easily the nVidia Proprietary drivers. So here is the reason of this gist, to store the install instructions in one place inside a crystal clear documentation.

Check your device

@Aetherus
Aetherus / writing-a-tsung-plugin.md
Created August 17, 2018 04:39 — forked from mremond/writing-a-tsung-plugin.md
Writing a Tsung Plugin

Writing a Tsung plugin

This is a simple tutorial on writing a tsung plugin and a repost of our ProcessOne tutorial.

Since tsung is used to test servers lets define a simple server for testing. myserver.erl provides 3 operations: echo, add and subtract.

myserver.erl assumes the first byte to be a control instruction followed by 2 or more byte data. The echo operation merely returns the byte data while add and subtract performs these operations on the 2 byte data before returning the results. See the code of myserver.erl for details.

We assume the source files for tsung-1.2.1 are available. This example was compiled using Erlang OTP R11B-3.