Skip to content

Instantly share code, notes, and snippets.

@ialeke
ialeke / git_create_orphan.sh
Created March 5, 2022 16:31 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@ialeke
ialeke / stringToHex.js
Created October 5, 2021 07:07
create dynamic hex color from string
function convert(string) {
const color = Number(
string
.split("")
.map((f) => f.charCodeAt(0))
.join("")
)
.toString(16)
.toUpperCase()
@ialeke
ialeke / app.js
Last active April 8, 2021 05:53
Using Phoenix Router and Vue Router
// 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 April 8, 2021 05:38
Jason.Encoder ecto example, removing __meta__ and %Ecto.Association.NotLoaded{}
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 March 13, 2020 10:18
Vuetify Template
<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