Skip to content

Instantly share code, notes, and snippets.

View mhanberg's full-sized avatar
🏎️
Move fast, break nothing

Mitchell Hanberg mhanberg

🏎️
Move fast, break nothing
View GitHub Profile
{
"test\/**\/components\/*_test.exs": {
"type": "test",
"template": [
"defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}Test do",
" use {dirname|camelcase|capitalize}.ConnCase, async: true",
"",
" alias {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}",
"end"
],
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
local wezterm = require("wezterm")
local home = "/Users/mitchell"
local icloud = string.format("%s/Library/Mobile Documents/com~apple~CloudDocs", home)
local src = string.format("%s/src", home)
local function isViProcess(pane)
-- get_foreground_process_name On Linux, macOS and Windows,
-- the process can be queried to determine this path. Other operating systems
-- (notably, FreeBSD and other unix systems) are not currently supported
return pane:get_foreground_process_name():find("n?vim") ~= nil
@mhanberg
mhanberg / next.json
Created June 29, 2023 14:58
coc-next-ls
"next-ls": {
"command": "/path/to/next-ls/bin/next-ls",
"args": [
"--stdio"
],
"filetypes": [
"elixir",
"eelixir",
"heex"
],
@mhanberg
mhanberg / comparison.md
Created November 6, 2022 18:53
silicon.lua v. screenshot

silicon.lua

This is a comparison of silicon.lua autogenerating a colorscheme for silicon from my vim theme. Seems pretty dang close!

silicon.lua

image

Screenshot

"some.CSV" |> File.read!() |> NimbleCSV.RFC4180.parse_string() |> Enum.group_by(fn t -> if(Enum.at(t, 2) =~ "Amazon", do: "Amazon" , else: Enum.at(t, 2)) end) |> Enum.map(fn {category, ts} -> {category, Enum.map(ts, &String.to_float(Enum.at(&1, 5)) |> abs()) |> Enum.sum} end) |> Enum.sort_by(fn {k, v} -> v end, :desc) |> inspect(pretty: true, limit: :infinity) |> IO.puts
@mhanberg
mhanberg / ecto-guide-style.ex
Created April 29, 2022 18:04
Factores with Ecto
# example from the ecto guides https://hexdocs.pm/ecto/test-factories.html
defmodule MyApp.Factory do
alias MyApp.Repo
# Factories
def build(:post) do
%MyApp.Post{title: "hello world"}
end
wezterm start --cwd "$PWD" -- bash -c "exec -a fzf bash $fifo3"
# boolean attributes
input type: "checkbox", disabled: true, checked: false
# <input type="checkbox" disabled>
# class object syntax
valid? = false
"scripts": {
"js": "esbuild ./js/app.js --target=es2015 --bundle --outdir=../priv/static/js --sourcemap",
"css": "postcss ./css/app.css --dir ../priv/static/css",
"copy": "cpx \"static/**/*\" ../priv/static",
"deploy": "yarn js --minify & yarn css & yarn copy"
}