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,
@nicholasjhenry
nicholasjhenry / gist:4176826
Created November 30, 2012 16:34
Heroku S3 Mirror (Bamboo)
export `heroku config \$@ | grep S3_ | sed -e "s/ //g" -e "s/>//g" | tr "\\n" " "`¬
@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 / .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 && \
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 / cheatsheet.md
Last active March 17, 2021 22:22
Absinthe GraphQL Schema Language Cheat Sheet

GraphQL Schema Language Cheat Sheet

The definitive guide to express your GraphQL schema succinctly

A port of a cheat sheet authored by Hafiz Ismail.

What does it look like?

defmodule MyApp.Schema do
 use Absinthe.Schema
@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 / gist:4070557
Created November 14, 2012 05:56
Deconstructing the Framework (Gary Bernhardt)

Design in the Small

  • Don't design a Model to be coupled to an API
  • Create a Service that talks to both your Model and the API

Service Wrapper Record

  • You have services, stateless objects that talk to the application
  • You have records, objects that talk to the database
  • And you have Wrappers, a thin class for a narrow interface to an API
@nicholasjhenry
nicholasjhenry / your_application.rb
Created October 22, 2011 04:56
PayRoll application, embedded in Rails, borrowing from Use Case Driven Architecture and DCI
## PayRoll gem
# lib/pay_roll.rb
module PayRoll
class << self
attr_accessor :employee_directory
def config
yield self
end
end