Skip to content

Instantly share code, notes, and snippets.

View trejo08's full-sized avatar

Juan Trejo trejo08

View GitHub Profile
@trejo08
trejo08 / postgresql_configuration_on_ubuntu_for_rails.md
Created May 13, 2018 07:51 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@trejo08
trejo08 / .rubocop.yml
Last active September 10, 2018 17:39
Preffered Rubocop configuration for rails
## Prefered rubocop conf for rails
## Source: https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
inherit_gem:
rubocop-rails_config:
- config/rails.yml
AllCops:
RubyInterpreters:
- ruby
# before run this command you have to configure a directory where the remote will be mounted and also have to configured a remote using rclone
~$ rclone mount --allow-non-empty --allow-other --daemon remote:remote_directory /path/to/local/target
@trejo08
trejo08 / morse.rb
Last active December 30, 2022 05:26
Morse Code translator written in Ruby as solution of CodementorX Assessment.
class Morse
def posibilities(signals)
signals.include?('?') ? check_wildcard(signals) : morses["#{signals}"]
end
def check_wildcard(signals)
length = signals.split('').length
values = []
if length.eql?(1)
values = ["E", "T"]
@trejo08
trejo08 / routes.js
Created July 19, 2019 20:47
List URLs for Vue using VueRouter
import Vue from "vue"
import VueRouter from "vue-router"
const router = new VueRouter({
routes,
})
function getRoutesList(routers, pre) {
return routers.reduce((array, route) => {
const path = `${pre}${route.path}`;
#!/bin/bash
## small hack to print $PATH var in readable mode
echo $PATH | awk '{split($0,a,":"); for (i in a) print a[i]}'

Stop all containers

docker kill $(docker ps -q)

Kill all containers

docker stop $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -q)

Remove all images

@trejo08
trejo08 / Dockerfile
Created February 13, 2020 14:51
example of multi-stages using two different images to relase a final
FROM golang:1.12-alpine AS gobuild
RUN apk update && apk add --no-cache gcc g++ make git
COPY ./ /build
WORKDIR /build
RUN GOOS=linux GOAR=amd64 go build -o binary
FROM jrottenberg/ffmpeg AS base-build
ENV PYENV_ROOT=/root/.pyenv
ENV PATH=$PYENV_ROOT/bin:$PATH
ENV PATH=$PYENV_ROOT/shims:$PATH
@trejo08
trejo08 / systemd-manager.md
Created February 28, 2020 21:44 — forked from illvart/systemd-manager.md
Install systemd-manager for Ubuntu/Arch Linux

Screenshot_2019-05-20_02-46-48

systemd-manager for ubuntu:

lsb_release -a

Example output:

Distributor ID: Ubuntu

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example