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
module Import | |
class Base | |
attr_accessor :type, :path, :file, :file_type | |
def initialize(params) | |
self.type = params[:type] | |
self.file = params[:file] | |
self.file_type = params[:file_type] | |
self.path = File.join(Rails.root, "public", self.file.original_filename) | |
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
source 'https://rubygems.org' | |
gem 'rails', '4.2.5' | |
gem 'pg' | |
gem 'turbolinks' | |
gem 'jbuilder', '~> 2.0' | |
gem 'bcrypt' | |
gem 'awesome_print' | |
gem 'mini_magick' | |
gem 'exceptions-resource', github: 'xdougx/exceptions-resource', require: 'exceptions' |
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
class ApplicationController < ActionController::Base | |
layout 'application' | |
end | |
class CategoriesController < ApplicationController | |
# app/views/categories/show.html.erb | |
def show | |
@category = Category.find(params[:id]) | |
end | |
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
# Depende da gem exceptions-resource, só procurar no meu git que você encontra | |
module Statusable | |
extend ActiveSupport::Concern | |
included do | |
available_statuses.each do |status| | |
scope status, -> { where(status: status) } | |
end | |
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
def search_city(city = "") | |
until hashcity.include?(city) do | |
city = gets.chomp | |
end | |
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
Error in ./boot.cr:12: instantiating 'Importation::Base#import()' | |
Importation::Base.new(App.new).import | |
^~~~~~ | |
in ./app/importation/base.cr:31: instantiating 'Importation::Runner#run()' | |
Importation::Runner.new(self, path).run | |
^~~ |
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
development: | |
encoding: utf8 | |
port: 5432 | |
database: development | |
username: username | |
password: | |
host: localhost | |
--- | |
test: | |
encoding: utf8 |
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
development: | |
encoding: utf8 | |
port: 5432 | |
database: development | |
username: username | |
password: | |
host: localhost | |
--- | |
test: | |
encoding: utf8 |
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 "crystal_executer/version" | |
require "active_support/core_ext/hash" | |
require "benchmark" | |
module ModuleBench | |
class Runner | |
def self.exec path, params = {} | |
m1 = Benchmark.bm do |x| | |
x.report("Ruby") do | |
a = [] |
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
module ClassProperty | |
macro class_property(*names) | |
class_getter {{*names}} | |
class_setter {{*names}} | |
end | |
macro class_property?(*names) | |
class_getter? {{*names}} | |
class_setter {{*names}} | |
end |
NewerOlder