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
| #!/bin/bash | |
| dig example.com +nostats +nocomments +nocmd |
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
| #!/bin/bash | |
| # https://git-scm.com/book/en/v2/Git-Basics-Tagging | |
| # $1 => version | |
| # $2 => comment | |
| # example: | |
| # git tag -a version -m "my tagged version" | |
| git tag -a $1 -m "$2" |
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
| class JungleController < ActionController::Base | |
| before_filter :is_there_a_hunter? | |
| inherit_resources | |
| protected | |
| def is_there_a_hunter? | |
| false | |
| end | |
| 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
| class GorillaController < JungleController | |
| def share_banana | |
| respond_to do |format| | |
| format.json { render :json => banana_json } | |
| end | |
| end | |
| def get_banana | |
| respond_to do |format| |
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
| FactoryGirl.define do | |
| factory :gorilla do | |
| first_name 'Björn' | |
| middle_name { Faker::Name.name } | |
| last_name { Faker::Name.last_name } | |
| end | |
| 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
| require 'rails_helper' | |
| RSpec.describe 'GET /api/v1/gorilla' do | |
| let(:gorilla) {FactoryGirl.create(:gorilla)} | |
| before { get '/api/v1/gorilla'} | |
| subject { response } |
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
| module Api | |
| module V1 | |
| class GorillaController < ApplicationController | |
| def index | |
| @gorillas = Gorilla.all | |
| render json: {message: 'We are not extinct. Just well hidden.'} | |
| end | |
| end | |
| end | |
| 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
| scope '/api', defaults: {format: 'json'} do | |
| scope '/v1' do | |
| scope '/gorilla' do | |
| get '/' => 'api/v1/gorilla#index' | |
| end | |
| end | |
| 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
| #!/bin/bash | |
| # Just a healthy reminder of the most used rvm commands. | |
| # Just uncomment those you might want to use | |
| # change gemset | |
| # rvm use ruby-version@gemset-name | |
| # create and change gemset | |
| # rvm use ruby-version@gemset-name --create |
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
| #!/bin/bash | |
| rails g mongoid:config |
NewerOlder