Skip to content

Instantly share code, notes, and snippets.

@JoeZ99
JoeZ99 / memory_monitor.ex
Last active April 9, 2024 10:19
A simple elixir "memory monitor"
defmodule MemoryMonitor do
@moduledoc """
This module implements a GenServer that monitors the memory usage of a process.
It periodically checks the memory consumption.
"""
use GenServer
@time_to_check :timer.seconds(10)
@Nezteb
Nezteb / elixir-language-server-comparison.md
Last active May 8, 2024 18:10
Elixir Language Server Comparisons

Elixir Language Server Implementation Comparison

We'll be comparing the following:

Disclaimers:

@sorentwo
sorentwo / start_oban_web.livemd
Created July 27, 2022 16:38
Single Page Oban Web

Single Page Oban Web

Application.put_env(:sample, Sample.Repo, database: "oban_dev")

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, Sample.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@Meroje
Meroje / scw_facts.py
Last active September 6, 2017 10:13
Ansible Scaleway custom facts, based on https://github.com/br0ziliy/ansible-module-gce-facts
#!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: scw_facts
'''
EXAMPLES = '''
# To see the list of all the facts use command below:
require 'anemone'
#The below count is manually extracted from https://www.linkedin.com/directory/topics-X where 'X' is the alphabet
word_to_char = {
a: 98, b: 100, c: 99, d: 99, e: 99, f: 97, g: 96, h: 95, i: 100, j: 88, k: 92, l: 97, m: 100,
n: 94, o: 99, p: 99, q: 87, r: 100, s: 100, t: 100, u: 94, v: 96, w: 100, x: 73, y: 53, z: 0
}
all_urls, skipped_urls = [], []
word_to_char.each{ |char, count| 1.upto(count) { |num| all_urls << "https://www.linkedin.com/directory/topics-#{char}-#{num}/" } }
@drwasho
drwasho / installobserver.sh
Last active April 15, 2016 02:52
Install the OpenBazaar server in one simple script for Ubuntu 14.04 (Trusty)
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install build-essential libssl-dev libffi-dev python-dev openssl python-pip libzmq3-dev
sudo add-apt-repository ppa:chris-lea/libsodium
sudo apt-get update
sudo apt-get -f install
sudo apt-get install libsodium-dev
sudo pip install cryptography