Skip to content

Instantly share code, notes, and snippets.


Tonći Galić Tuxified

View GitHub Profile
astutecat /
Last active Nov 1, 2021
Notes on setting up Nix on MacOS.
set -e
root_disk() {
diskutil info -plist /
apfs_volumes_for() {
diskutil apfs list -plist "$disk"
archan937 /
Last active Feb 28, 2019
Alkmaar Elixir Meetup (20-06-2018)

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:
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
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
gemfile(true) do
source ""
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 /
Last active Jan 14, 2021
Load Test Phoenix Presence

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 / 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
JEG2 / counter.rb
Created Jan 25, 2017
A wannabe GenServer.
View counter.rb
class Counter
def initialize(initial_count = 0)
@mailbox =
@replies =
@state = initial_count
@server = process_messages
def increment
mailbox.push([:handle_increment, 1])
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
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