Skip to content

Instantly share code, notes, and snippets.

View allefgomes's full-sized avatar
:shipit:
Elixir | Ruby 💎

Allef Gomes allefgomes

:shipit:
Elixir | Ruby 💎
View GitHub Profile
@reu
reu / tmux.conf
Created September 10, 2023 18:03
set -g default-terminal "screen-256color"
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-option -sa terminal-overrides ",xterm*:Tc"
set -s escape-time 10
setw -g xterm-keys on
set -g mouse on
setw -g mode-keys vi
unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
set -g base-index 1
@theguuholi
theguuholi / configvscode.md
Last active June 29, 2021 00:10
Elixir and VsCodeConfig

Plugins: ElixirLinter ElixirLS Beautify Better Comments Bracket Pair Colorizer Docker HtmlSnippets

@vquaiato
vquaiato / papo_experiencia.txt
Created May 24, 2020 03:27
Um papo sobre experiência na live
senior é quem tem cicatriz
Experiência
- estudos
- Orientação a Objetos
- Padrões
- Design Patterns
- Padrões de arquitetura de aplicações
- Design de código
@bergpb
bergpb / install-docker.sh
Created February 11, 2019 02:14 — forked from sethbergman/install-docker.sh
Install Docker CE on Linux Mint 19
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@bergpb
bergpb / convert_doc_to_pdf.py
Last active April 11, 2018 11:36
Convert '.doc' into a '.pdf' file.
# -*- coding: utf-8 -*-
import os
#install this dependency
#sudo apt-get install unoconv
for file in os.listdir(os.getcwd()):
#remove all spaces in filename
new_file = file.replace(' ', '_')
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
@mankind
mankind / rails-jsonb-queries
Last active May 23, 2024 06:47
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@kelvinst
kelvinst / create-ruby-gem.md
Last active July 19, 2024 14:20
Como criar uma gem ruby?

Como criar uma gem ruby?

Escolhi tratar sobre esse assunto hoje simplesmente porque foi uma das primeiras coisas que me perguntei "como eu faço isso?" no mundo ruby. Acredito que muita gente se pergunte a mesma coisa e espero que eu possa ajudar em algo para elas. 😀

O que é uma gem?

Bem, se você é um programador java, você chama sua gem de jar, se você é um programador C#, você chama de dll. Resumindo, é uma lib, uma biblioteca contendo códigos que você pode reaproveitar importando em outros projetos.

E usar gems no ruby é muito fácil, se você já deu uma brincada com rails por exemplo, é só você adicionar o código gem 'nome_da_gem' no arquivo Gemfile que está no root, depois executar o comando bundle install para baixar sua gem do repositório e pronto, só sair usando a biblioteca!

@lancejpollard
lancejpollard / format_attributes.rb
Created December 3, 2010 20:20
Format attributes when they are set in ActiveRecord
module FormatAttribute
unloadable
def self.included(base)
base.class_eval do
class << self
# format :cash, :except => "$"
# format :date do |value|
# Date.parse(value)
# end