This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if has('vim_starting') | |
set runtimepath+=~/.config/nvim/ | |
endif | |
" Coc setup | |
set hidden | |
set nobackup | |
set nowritebackup | |
" Better display for messages | |
set cmdheight=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scriptencoding utf-8 | |
if has('vim_starting') | |
set runtimepath+=~/.config/nvim/ | |
endif | |
set guifont=Menlo\ Regular:h16 | |
" ============================================================================ " | |
" === PLUGINS === " | |
" ============================================================================ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g mouse on | |
set -sg escape-time 0 | |
# Setting the prefix from C-b to C-a | |
set -g prefix C-a | |
# Free the original Ctrl-b prefix keybinding | |
unbind C-b | |
# Reload the file with Prefix r | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
# List of plugins | |
set -g @plugin 'tmux-plugins/tpm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
type = cat-file -t | |
dump = cat-file -p | |
update-from = "!f() { git fetch $1 --prune; git merge --ff-only $1/$2 || git rebase --preserve-merges $1/$2; }; f" | |
[user] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
export LANG="en_US.UTF-8" | |
export LC_COLLATE="en_US.UTF-8" | |
export LC_CTYPE="en_US.UTF-8" | |
export LC_MESSAGES="en_US.UTF-8" | |
export LC_MONETARY="en_US.UTF-8" | |
export LC_NUMERIC="en_US.UTF-8" | |
export LC_TIME="en_US.UTF-8" | |
export LC_ALL="en_US.UTF-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
let mapleader = ',' | |
set wildmenu | |
set autoread | |
set encoding=utf-8 | |
" ----- Powerline ---------------------------------- | |
set guifont=Meslo\ LG\ L\ DZ\ for\ Powerline:h14 | |
let g:Powerline_symbols = 'fancy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Part of the code in the controller | |
if changeset_order.valid? do | |
Repo.transaction fn -> | |
# Save Order | |
order = changeset_order | |
|> Repo.insert! | |
|> Repo.preload(:buyer) | |
# Save Order Products |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create(conn, _params) do | |
case Plug.Conn.read_body(conn) do | |
{:ok, body, conn} -> | |
{:ok, data} = Poison.decode(body) | |
{:error, reason} -> | |
render(ExRushlookApi.OrderView, "error.json", error: reason) | |
end | |
# Get Buyer | |
user = Repo.get_by!(User, email: "[email protected]) |> Repo.preload(:buyer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 def render("show.json", %{category: category}) do | |
9 category |> IO.inspect | |
10 %{id: category.id, | |
11 name: category.name, | |
12 slug: category.slug, | |
13 parent_id: category.parent_id, | |
14 products: render_many(category.products, ExRushlookApi.ProductView, "show.json", as: :product) } | |
15 |> add_subcategories(category) | |
16 end | |
17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render("product.json", %{product: product}) do | |
%{id: product.id, | |
name: product.name, | |
description: product.description, | |
price: product.price} | |
|> add_options(product) | |
end | |
defp add_options(json, %{product: product}) do | |
options = |
NewerOlder