Skip to content

Instantly share code, notes, and snippets.

View mraaroncruz's full-sized avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / install.md
Last active April 14, 2023 15:10
Install older OTP versions when you have OpenSSL version >= 3.0

There is an issue with openssl < 3.0 and most versions of Erlang

To fix, install openssl into some directory

cd /usr/local/src
sudo mkdir openssl
sudo chown username:staff openssl
cd openssl
git clone git://git.openssl.org/openssl.git
@mraaroncruz
mraaroncruz / working_webserver.livemd
Created September 1, 2022 23:22
A livebook with a running http server that can accept requests

Working webserver

Mix.install([
  {:plug_cowboy, "> 0.0.0"},
  {:jason, "> 0.0.0"},
  {:httpoison, "> 0.0.0"}
])
@mraaroncruz
mraaroncruz / foo.ex
Created August 17, 2022 13:00
ExUnit.run()
ExUnit.start(auto_run: false)
defmodule CalculatorTest do
use ExUnit.Case, async: false
describe "Testing the addition function" do
test "2 plus 3 is 5" do
assert 2 + 2 == 5
end
end
end
@mraaroncruz
mraaroncruz / butter-chicken.md
Last active March 18, 2021 18:45
Butter chicken recipe

Ingredients

  • 2 Chicken Breasts small chunks
  • 3 EL butter
  • 10 small tomatoes (or 1 cup tomato sauce)
  • 1 cup tomato sauce
  • 1 onion (medium cubes)
  • 3 cloves garlic (smashed)
  • 2 EL Ginger (or ginger puree)
  • 30g Cashews (a handful?) (I also used some peeled almonds but whatever you have I guess)
@mraaroncruz
mraaroncruz / solr_client.ex
Created February 15, 2021 10:33
Quick implementation of a Solr client in Elixir
defmodule MyApp.Search.SolrClient do
require Logger
def url, do: Application.get_env(:my_app, :solr)[:url]
def select_url(url), do: "#{url}/select"
def update_url(url), do: "#{url}/update"
def update_json_url(url), do: "#{url}/update/json/docs"
def select(params) when is_list(params) do
@mraaroncruz
mraaroncruz / questions.md
Created November 13, 2020 16:38
DreamClients general interview pre-questions

DreamClients Podcast Interview Questions

The goal of the podcast is to help people find ways to get better clients, and to get more of them (more, better clients?).

Filling the pipeline

  • Do you have any hacks to fill your pipeline?
  • Where do most of your clients come from?
  • What types of activities do you do every day or week that helps you fill the pipeline?
  • Do you remember what you did in the beginning to get more clients? Do you do things differently now? Why?
  • What advice would you give to a freelance software dev just starting out?
@mraaroncruz
mraaroncruz / Dockerfile
Created October 29, 2020 10:03
webkoll docker implementation (ugly)
FROM elixir:latest
RUN apt-get update && \
apt-get install -y python rsync
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt update \
&& apt install -y nodejs yarn
@mraaroncruz
mraaroncruz / docker-compose.yml
Created May 20, 2020 12:45
Docker compose for influxdb and grafana
version: "3"
services:
influxdb:
image: influxdb:latest
ports:
- "127.0.0.1:8083:8083"
- "127.0.0.1:8086:8086"
- "127.0.0.1:8090:8090"
env_file:
- "env.influxdb"
@mraaroncruz
mraaroncruz / routes.json
Created December 19, 2019 09:01
Example response from route API
{
"route": {
"weight_name": "routability",
"legs": [
{
"summary": "S5, S33",
"steps": [
{
"intersections": [
{
@mraaroncruz
mraaroncruz / install_docker_and_compose.bash
Last active December 11, 2019 08:55
Bootstrap docker and compose on new machine
#!/bin/bash
# Run like
# $ curl https://gist.githubusercontent.com/mraaroncruz/a3c19e4b901846bea872e5f24e617d55/raw/2948b92e094215542c9679a9384694c5c6e5e9dd/install_docker_and_compose.bash | bash
set -e
setup () {
### Update the apt package index:
sudo apt update