Skip to content

Instantly share code, notes, and snippets.

View arissonb's full-sized avatar

Arisson Brasil arissonb

View GitHub Profile
@arissonb
arissonb / docker-compose.yml
Last active November 29, 2021 21:16
Creating file for docker-compose postgresql and pgadmin4
version: '3'
services:
postgres-compose:
image: postgres
container_name: postgres
environment:
POSTGRES_USER: "root"
POSTGRES_PASSWORD: "root"
ports:
@arissonb
arissonb / docker+wordpress+mariadb+phpmyadmin.txt
Created November 25, 2019 12:57 — forked from alexishida/docker+wordpress+mariadb+phpmyadmin.txt
Docker config wordpress mariadb phpmyadmin
docker run -d \
--name=mariadb \
--restart=always \
-v /etc/localtime:/etc/localtime:ro \
-e MYSQL_ROOT_PASSWORD=senha \
-v /storage/mariadb:/var/lib/mysql \
mariadb:latest
docker run -d \
--restart=always \
@arissonb
arissonb / configuration.txt
Last active December 5, 2019 05:07
Bootstrap installation on rails 6 using yarn
1° step
Enter the project directory and run this command
yarn add bootstrap jquery popper.js
2° step
Add this code inside the file config/webpack/environment.js
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
@arissonb
arissonb / docker-compose.yml
Created December 4, 2020 01:44
Creating file for docker-compose mongodb and express
version: '3'
services:
mongo-express:
image: mongo-express
container_name: mongoexpress
ports:
- 8081:8081
environment:
ME_CONFIG_BASICAUTH_USERNAME: mongoadmin
@arissonb
arissonb / rails-jsonb-queries
Created May 5, 2022 17:59 — forked from mankind/rails-jsonb-queries
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")