Skip to content

Instantly share code, notes, and snippets.

View mhanberg's full-sized avatar
🏎️
Vroom

Mitchell Hanberg mhanberg

🏎️
Vroom
View GitHub Profile
@mhanberg
mhanberg / 1before.fnl
Last active September 16, 2022 14:27
(module dotfiles.module.core
{require {core aniseed.core
util dotfiles.util
nvim aniseed.nvim}})
(set nvim.o.syntax "true")
(set nvim.o.splitbelow true)
(set nvim.o.termguicolors true)
(set nvim.o.foldmethod "syntax")
(set nvim.o.foldlevelstart 99)
defmodule BifrostWeb.RoutineLive.Show do
use BifrostWeb, :live_view
alias Bifrost.Health
@impl true
def mount(_params, _session, socket) do
{:ok, assign_breadcrumb(socket, "Routines", Routes.routine_index_path(socket, :index))}
end
@mhanberg
mhanberg / feature.ex
Created November 30, 2020 19:44
wallaby
defmodule BifrostWeb.FeatureCase do
use ExUnit.CaseTemplate
import Bifrost.AccountsFixtures
alias BifrostWeb.Router.Helpers, as: Routes
using do
quote do
use Wallaby.Feature
import Bifrost.AccountsFixtures
import Bifrost.HealthFixtures
defmodule Mix.Tasks.D03.P1 do
use Mix.Task
import AdventOfCode.Day03
@shortdoc "Day 03 Part 1"
def run(args) do
# Downloads your input for the given day and year
# and caches it in ~/.cache.
input = AdventOfCode.Input.get!(3, 2020)
go fuck yourself
@mhanberg
mhanberg / endpoint.ex
Last active February 19, 2021 01:33
esbuild + postcss-cli in phoenix
import Config
# Configure your database
config :my_app, MyApp.Repo, show_sensitive_data_on_connection_error: true
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
=== running autoconf in lib/common_test
=== running autoconf in lib/crypto
=== running autoconf in lib/erl_interface
=== running autoheader in lib/erl_interface
=== running autoconf in lib/megaco
-- We're going to install the package manager, packer.nvim
-- It is based on (n)vims native package management
-- Let's install it into ~/.local/share/nvim
local install_path = vim.fn.stdpath("data").."/site/pack/packer/opt/packer.nvim"
-- If it's not already installed, let's download it
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.api.nvim_command.execute("!git clone https://github.com/wbthomason/packer.nvim "..install_path)
end
@mhanberg
mhanberg / live_view.ex
Created March 9, 2021 18:17
Using Temple directly in live view modules
# lib/my_app/views/live_view.ex
defmodule MyAppWeb.LiveView do
defmacro render(block) do
quote do
def render(var!(assigns)) do
require Temple
Temple.compile(unquote(Phoenix.LiveView.Engine), unquote(block))
end
end
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
grey: defaultTheme.colors.gray
},