Skip to content

Instantly share code, notes, and snippets.

View jhonnatas's full-sized avatar
🎯
Focusing

Jhonnatas Alencar jhonnatas

🎯
Focusing
View GitHub Profile
@Godoy
Godoy / gist:4538424
Last active June 16, 2020 17:44
Desfazendo coisas no Rails
$ rails generate controller Noticias titulo
$ rails destroy controller Noticias titulo
$ rails generate model Noticia titulo:string
$ rails destroy model Noticia
$ rake db:migrate
$ rake db:rollback
$ rake db:migrate VERSION=0 #defaz todas as migrations, deixa o banco "limpo"
@mlr
mlr / rspec_rails_cheetsheet.rb
Last active October 26, 2023 14:32 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet with expect syntax (including capybara matchers)
# Model
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
# Rendering
expect(response).to render_template(:index)
# Redirecting
@vlandham
vlandham / part1.md
Last active March 21, 2024 12:57
Feature Branches and Pull Requests : Walkthrough

Here's a little walkthrough of how Yannick and I are using feature branches and pull requests to develop new features and adding them to the project. Below are the steps I take when working on a new feature. Hopefully this, along with watching the process on Github, will serve as a starting point to having everyone use a similar workflow.

Questions, comments, and suggestions for improvements welcome!

Start with the latest on master

When starting a new feature, I make sure to start with the latest and greatest codebase:

git checkout master
@fjahr
fjahr / application.html.erb
Last active October 4, 2021 10:35 — forked from suryart/application.html.erb
Displaying Rails 5 flash messages with Twitter Bootstrap 4 (last tested on Alpha-v6). Updated version of https://gist.github.com/suryart/7418454
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@yunga
yunga / Chocolatey.md
Created April 4, 2019 22:10
Chocolatey Cheat Sheet

Chocolatey

Homepage: Chocolatey.org

Chocolatey is a machine-level package manager and installer for software packages, built for the Windows NT platform.

It is an execution engine using the NuGet packaging infrastructure and Windows PowerShell to provide an automation tool for installing software on Windows machines, designed to simplify the process from the user perspective.

The name is an extension on a pun of NuGet (from "nougat") "because everyone loves Chocolatey nougat".