Skip to content

Instantly share code, notes, and snippets.

View esdras's full-sized avatar

Esdras Mayrink esdras

View GitHub Profile
call plug#begin('~/.local/share/nvim/plugged')
"
" Plugins from: https://hannadrehman.com/top-neovim-plugins-for-developers-in-2022
" Rust setup from: https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/
"
"
Plug 'rust-lang/rust.vim'
Plug 'scrooloose/nerdcommenter' "
Plug 'phaazon/hop.nvim' "keyword base navigation
defmodule MyApp.Users.Input do
@moduledoc false
@type params :: map() | Keyword.t()
alias MyApp.Utils
alias MyApp.Users.{User}
defmodule Create do
@moduledoc """
Input for `MyApp.Users.create/1`
@esdras
esdras / router.ex
Last active May 13, 2019 18:29
Phoenix Router - scope vs pipeline
# Router é feito com macros, pipeline e scopes são macros.
# O `scope` é um grupo de rotas que compartilham determinado prefixo.
# Você pode criar um escopo para agrupar as rotas do painel admin de uma aplicação
# e outro para a API json da sua aplicação, etc..
# rotas da área admin do sistema
scope "/admin", MeuAppWeb.Admin do
get "/foo/new", FooController, :new # vai ser compilado como: GET /admin/foo/new
end
@esdras
esdras / Sentry-Install-Ubuntu-16-04
Created November 30, 2018 18:54 — forked from RabbitMC/Sentry-Install-Ubuntu-16-04
Setup sentry on Ubuntu 16.04 server
# Project: https://github.com/getsentry/sentry
# Doc: https://docs.getsentry.com/on-premise/server/installation/python/
udo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo apt-get install libxslt1-dev
sudo apt-get install gcc
@esdras
esdras / install_sentry.sh
Created November 30, 2018 18:54 — forked from bjmc/install_sentry.sh
Basic setup script for installing Sentry (http://getsentry.com) + Redis on new Ubuntu 14.04 Amazon EC2 instance
#! /bin/bash
export RUN_AS='ubuntu';
export INSTALL_DIR='/var/www/sentry';
HOSTNAME='http://mysentry.example.com'; # No trailing slash
DB_HOST='something.rds.amazonaws.com';
DB_PORT='5432';
DB_USER='sentry';
DB_NAME='sentry';
DB_PASSWORD='DB_PASSWORD';
@esdras
esdras / network-tweak.md
Created April 27, 2018 20:35 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@esdras
esdras / run phoenix on amazon linux.sh
Last active November 14, 2016 23:05 — forked from eikes/run phoenix on amazon linux.sh
run phoenix on amazon linux
# app deps
sudo yum update -y
# utf8 all the things
echo '
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
' >> ~/.bashrc
@esdras
esdras / sqlEmbeddedInVim.vim
Created September 20, 2016 22:03
SQL embedded in vim heredoc string
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sql
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use with vim-polyglot
" paste in vim-polyglot/after/syntax/ruby.vim
let s:bcs = b:current_syntax
unlet b:current_syntax
syn include @SQL syntax/pgsql.vim
let b:current_syntax = s:bcs
syntax region rubyHereDocSQL matchgroup=Statement start=+<<\z(SQL\)+ end=+^\z1$+ contains=@SQL
@esdras
esdras / config.ex
Created September 10, 2016 18:36 — forked from bitwalker/config.ex
Useful config wrapper for Elixir
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@doc """
Fetches a value from the config, or from the environment if {:system, "VAR"}
is provided.
An optional default value can be provided if desired.
module App exposing (..)
import Html exposing (..)
import Html.App as HtmlApp
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import String
import Set exposing (Set)
import Dict exposing (Dict)