Skip to content

Instantly share code, notes, and snippets.

⚗️
Elixiring

Tonći Galić Tuxified

⚗️
Elixiring
Block or report user

Report or block Tuxified

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@archan937
archan937 / README.md
Last active Feb 28, 2019
Alkmaar Elixir Meetup (20-06-2018)
View README.md

Alkmaar Elixir Meetup demo (20-06-2018)

A simple host and client script written in Elixir. Hosting a little Elixir quiz.

Running locally (on your own computer)

Run the following in two Terminal windows:

iex -r host.ex
View gist:af9abf6b3600d2d7f08dba58fdfb514a
Originally from: http://erlang.org/pipermail/erlang-questions/2017-August/093170.html
For a safe and fast Erlang SSL server, there's a few
configuration values you might want by default:
[{ciphers, CipherList}, % see below
{honor_cipher_order, true}, % pick the server-defined order of ciphers
{secure_renegotiate, true}, % prevent renegotiation hijacks
{client_renegotiation, false}, % prevent clients DoSing w/ renegs
{versions, ['tlsv1.2', 'tlsv1.1']}, % add tlsv1 if you must
View rails_single_file.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@yonkeltron
yonkeltron / mix.exs
Last active Feb 22, 2019
OpenTracing in Elixir with Otter
View mix.exs
defmodule Ot.Mixfile do
use Mix.Project
def project do
[app: :ot,
version: "0.1.0",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
@mmmries
mmmries / 01.README.md
Last active Oct 5, 2019
Load Test Phoenix Presence
View 01.README.md

Phoenix Nodes

First I created 3 droplets on digital ocean with 4-cores and 8GB of RAM. Login as root to each and run:

sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@darkphnx
darkphnx / super_simple_service.rb
Last active Mar 23, 2017
Simple, hot-restartable Ruby service
View super_simple_service.rb
require 'socket'
class SuperSimpleService
attr_reader :bind_address, :bind_port
def initialize
@bind_address = 'localhost'
@bind_port = 12345
end
@JEG2
JEG2 / counter.rb
Created Jan 25, 2017
A wannabe GenServer.
View counter.rb
class Counter
def initialize(initial_count = 0)
@mailbox = Queue.new
@replies = Queue.new
@state = initial_count
@server = process_messages
end
def increment
mailbox.push([:handle_increment, 1])
@vic
vic / ex14parens.rb
Created Dec 9, 2016
Add missing parentheses to avoid Elixir 1.4 warnings on function calls.
View ex14parens.rb
#!/usr/bin/env ruby
###
# This utility adds missing parentheses to single word function calls
# that are now treated as warnings on Elixir 1.4.
#
# Download this file on your project repo and execute
# ruby ex14parens.rb --help
####
require('fileutils')
@coreyhaines
coreyhaines / Animation.elm
Last active Jun 19, 2017
Animation support library
View Animation.elm
module Animation exposing (..)
import Task
import Process
import Time exposing (Time, millisecond)
type Animation state
= Setup state
| Animate state
@bitwalker
bitwalker / config.ex
Created Jul 19, 2016
Useful config wrapper for Elixir
View config.ex
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@doc """
Fetches a value from the config, or from the environment if {:system, "VAR"}
is provided.
An optional default value can be provided if desired.
You can’t perform that action at this time.