Skip to content

Instantly share code, notes, and snippets.

View gitDbits's full-sized avatar
🏠
Working from home

Diego Noronha gitDbits

🏠
Working from home
View GitHub Profile
@gitDbits
gitDbits / http_status_code_ruby.txt
Created October 27, 2021 17:26
HTTP Status code symbol ruby
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@gitDbits
gitDbits / command_database_rails .txt
Last active September 9, 2021 15:07
commands database Rails
Usual commands:
db:create - Cria o banco de dados para o ambiente corrente (development, test ou production).
db:drop - Exclui o banco de dados para o ambiente corrente (development, test ou production).
db:migrate - Roda as migrations para o ambiente corrente.
db:rollback - Desfaz o último arquivo de migration.
@gitDbits
gitDbits / Docker
Created August 6, 2021 16:55
Annotations docker
# run Dockerfile local
docker build -f Dockerfile -t grubber_m4u .
*.rbc
capybara-*.html
.rspec
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
begin
@lesson = Lesson.find(params[:id]) if current_user
@lesson = Lesson.by_teacher(current_teacher).find(params[:id]) if current_teacher
rescue ActiveRecord::RecordNotFound => e
redirect_to lessons_path, flash: { warning: "Impossible localized record" }
end
@gitDbits
gitDbits / Install PhantomJS
Last active November 3, 2020 20:58
Phantom JS for SGPP
# How to install PhantomJS on Ubuntu
Version: `1.9.8`
Platform: `x86_64`
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@gitDbits
gitDbits / Default Terminal Linux
Last active November 3, 2020 20:57
Set Default Terminal Linux
gsettings set org.gnome.desktop.default-applications.terminal exec 'konsole'
@gitDbits
gitDbits / scroll_nice
Last active September 18, 2020 00:28
Add implementation ScrollTop anchor HTML JS
# Rails 6
# execute command webpack jquery
yarn add jquery
# application.js
require("jquery")
# environment.js
const webpack = require('webpack')
environment.plugins.prepend('Provide',
@gitDbits
gitDbits / create_repositore_github
Created August 25, 2020 00:11
How to create repositore via terminal
Setting up a new Git Repo
========================
##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:alexpchin/<reponame>.git
@gitDbits
gitDbits / kill server rails
Created July 1, 2020 23:03
Kill service rails localhost
kill -9 $(lsof -i tcp:3000 -t)