This file contains 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
# spec/support/db_cleaner.rb | |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :transaction | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do |
This file contains 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
# ~/.zshrc | |
alias migratetestdb='rake db:migrate RAILS_ENV=test' | |
alias droptestdb='rake db:drop RAILS_ENV=test; rake db:create RAILS_ENV=test; rake db:migrate RAILS_ENV=test' | |
alias resettestdb='rake db:reset RAILS_ENV=test' |
This file contains 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
# spec/factories/factory.rb | |
factory :factory_name, class: Klass do | |
skip_create | |
ignore do | |
variable "Hello" | |
end | |
initialize_with do |
This file contains 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
Show hidden characters
{ | |
"auto_complete_commit_on_tab": false, | |
"theme": "itg.flat.dark.sublime-theme", | |
"color_scheme": "Packages/Theme - itg.flat/itg.dark.tmTheme", | |
"itg_small_tabs": true, | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" |
This file contains 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 'virtus' | |
class Page | |
include Virtus.model | |
attribute :title, String | |
attribute :font, String, :default => 'Helvetica' | |
attribute :header, String, :default => 'Welcome' | |
attribute :author, String, :default => 'Mies', :allow_nil => false | |
end |
This file contains 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
{"swagger":"2.0","info":{"version":"v0","title":"Test application","description":"Documents the V0 API of the Test application.","contact":{"name":"Jan"},"license":{"name":"MIT"}},"host":"localhost:3000","basePath":"/api/v0","consumes":["application/json"],"produces":["application/json"],"paths":{"/profiles":{"get":{"description":"Finds all Profiles","operationId":"findPets","responses":{"200":{"description":"Profiles response","schema":{"type":"array","items":{"$ref":"#/definitions/Profile"}}}}}},"/profiles/{id}":{"get":{"description":"Finds a Profile","operationId":"findPetById","parameters":[{"name":"id","in":"path","description":"Pseudonym of the Profile","required":true,"type":"string"}],"responses":{"200":{"description":"Profile response","schema":{"$ref":"#/definitions/Profile"}}}}}},"definitions":{"Profile":{"required":["id","type"],"properties":{"id":{"type":"string"},"type":{"type":"string"}}}}} |
This file contains 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 'net/http' | |
def ping(endpoint) | |
uri = URI.parse(endpoint) | |
http = Net::HTTP.new(uri.host, uri.port) | |
if uri.scheme == 'https' | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
end |
OlderNewer