Skip to content

Instantly share code, notes, and snippets.

@ialeke
ialeke / app.js
Last active Apr 8, 2021
Using Phoenix Router and Vue Router
View app.js
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import "../css/app.scss";
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import deps with the dep name or local files with a relative path, for example:
@ialeke
ialeke / jason_encoder_example.ex
Last active Apr 8, 2021
Jason.Encoder ecto example, removing __meta__ and %Ecto.Association.NotLoaded{}
View jason_encoder_example.ex
defimpl Jason.Encoder, for: [Example.Module1, Example.Module2] do
def encode(value, opts) do
value
|> process_for_json
|> Jason.Encode.map(opts)
end
def remove_unloaded({_field, %Ecto.Association.NotLoaded{}}, accum), do: accum
@ialeke
ialeke / index.html
Created Mar 13, 2020
Vuetify Template
View index.html
<div id="app">
<v-app id="inspire">
<v-navigation-drawer
v-model="drawer"
:clipped="$vuetify.breakpoint.lgAndUp"
app
>
<v-list dense>
<template v-for="item in items">
<v-layout