This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run Dockerfile local | |
docker build -f Dockerfile -t grubber_m4u . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.rbc | |
capybara-*.html | |
.rspec | |
/db/*.sqlite3 | |
/db/*.sqlite3-journal | |
/db/*.sqlite3-[0-9]* | |
/public/system | |
/coverage/ | |
/spec/tmp | |
*.orig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsettings set org.gnome.desktop.default-applications.terminal exec 'konsole' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 6 | |
# execute command webpack jquery | |
yarn add jquery | |
# application.js | |
require("jquery") | |
# environment.js | |
const webpack = require('webpack') | |
environment.plugins.prepend('Provide', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill -9 $(lsof -i tcp:3000 -t) |
NewerOlder