Skip to content

Instantly share code, notes, and snippets.

View nicholasjhenry's full-sized avatar

Nicholas Henry nicholasjhenry

View GitHub Profile
@nicholasjhenry
nicholasjhenry / clutter-free-vscode.jsonc
Created January 3, 2024 06:39 — forked from kamilogorek/_screenshot.md
Clutter-free VS Code Setup
// Required Plugin: https://marketplace.visualstudio.com/items?itemName=drcika.apc-extension
// settings.json
{
// Remove left-side icons
"workbench.activityBar.location": "hidden",
// Remove bottom status bar
"workbench.statusBar.visible": false,
// Remove position indicator in the editor's scrollbar
"editor.hideCursorInOverviewRuler": true,
defmodule Executable do
@moduledoc """
Executables are either commands or queries.
They should declare a struct that dictates the shape and defaults of their
parameters and a `handle_execute/1` function that takes that struct and does
something in response.
"""
use Behaviour
@nicholasjhenry
nicholasjhenry / README.md
Created January 12, 2022 20:04
Notes for an annotation SDK

Updated Instructions

Updated instructions for "small tweaks to the Hypothesis client" outlined in Notes for an annotation SDK.

  1. Clone the Hypothesis client: https://github.com/hypothesis/client
  2. Clone the Hypothesis browser extension: https://github.com/hypothesis/browser-extension
  3. Edit browser-extension/gulpfile.js adding const IS_PRODUCTION_BUILD = false. This turns off minification so it’s possible to read and debug the client code.
  4. Establish a link between the client and browser-extension repos (see more details in
@nicholasjhenry
nicholasjhenry / .gitpod.apt.Dockerfile
Last active December 15, 2022 00:12
Gitpod (don't do this, use asdf)
FROM gitpod/workspace-full
USER gitpod
# Erlang: https://computingforgeeks.com/how-to-install-latest-erlang-on-ubuntu-linux/
RUN wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
RUN echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
RUN sudo apt-get update && \
sudo apt-get install inotify-tools -y && \
@nicholasjhenry
nicholasjhenry / output.txt
Created March 2, 2021 14:56
Python Installation Issue
➜ git:(master) asdf install python 3.8.1
python-build 3.8.1 /Users/nicholas/.asdf/installs/python/3.8.1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.1.tar.xz...
-> https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
Installing Python-3.8.1...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
@nicholasjhenry
nicholasjhenry / application.ex
Created May 5, 2020 19:32 — forked from gvaughn/application.ex
Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly.
defmodule MasterProxy.Application do
alias MyApp.Endpoint, as: MyAppEndpoint
alias MyApp.UserSocket, as: MyAppUserSocket
alias MyOtherApp.Endpoint, as: MyOtherAppEndpoint
alias MyOtherApp.UserSocket, as: MyOtherAppUserSocket
alias Phoenix.LiveReloader.Socket, as: LiveReloadSocket
alias Plug.Cowboy
@nicholasjhenry
nicholasjhenry / example.exs
Created April 17, 2020 15:58
Run a single Elixir test outside of a project
# elixir example.exs
ExUnit.start
defmodule ExampleTest do
use ExUnit.Case
test "example" do
assert true == true
end
end
@nicholasjhenry
nicholasjhenry / main.py
Last active January 6, 2020 17:05
Quick example of Pandas
# main.py
# exec(open("./main.py").read(), globals())
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
my_numpy_array = np.random.rand(3)
my_series = pd.Series(my_numpy_array)
my_series.plot()
@nicholasjhenry
nicholasjhenry / README.md
Last active October 10, 2023 15:31
Observer Elixir/BEAM inside a running Docker container using SSH

Add ports to docker-compose.yml:

    - "4369:4369"
    - "9001:9001"
    - "2022:22"

Add this to Dockerfile:

@nicholasjhenry
nicholasjhenry / equality.exs
Last active August 17, 2019 17:21
Example of implementing equality
defmodule EqualityExample do
import Kernel, except: [==: 2]
defprotocol Eq do
def eq?(x, y)
end
defimpl Eq, for: Integer do
def eq?(x, y) when is_integer(y) do
IO.inspect("#{x} == #{y}")