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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Blog Curso Ruby On Rails</title> | |
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> | |
<%= javascript_include_tag "application", "data-turbolinks-track" => true %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> | |
<div class="container"> |
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
NoMethodError: undefined method `compile' for #<String:0xb382808> | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:17:in `to_sql' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:36:in `select_all' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/relation/calculations.rb:264:in `execute_simple_calculation' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/relation/calculations.rb:221:in `perform_calculation' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/relation/calculations.rb:127:in `calculate' | |
from /home/douglas/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0/lib/active_record/relation/calculat |
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
declare | |
a clob; | |
begin | |
a := '2015-11-26 20:21:42`a,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WMobileServer]] I, [2015-11-26T20:21:42.715000 #29889] 2015-11-26 20:21:42,715 INFO [org.apache.catalina.core.ContainerBase.[jboss. |
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 composicao | |
comp = ProdutoCompos.arel_table | |
prod = Produto.arel_table | |
sql = comp. | |
join(prod).on(comp[:w_id_produto].eq(prod[:w_id])). | |
where(prod[:mob_dt_alteracao].gteq(@vendedor.last_sync). | |
or(comp[:mob_dt_alteracao].gteq(@vendedor.last_sync))). | |
take(params[:limit]). | |
skip(params[:offset]). |
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
function simulateDragDrop(sourceNode, destinationNode) { | |
var EVENT_TYPES = { | |
DRAG_END: 'dragend', | |
DRAG_START: 'dragstart', | |
DROP: 'drop' | |
} | |
function createCustomEvent(type) { | |
var event = document.createEvent("CustomEvent") | |
event.initCustomEvent(type, true, true, null) |
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
.home_controller.index_action { | |
background-color: blue; | |
} |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'active_support' | |
# example input: | |
# {"output_groups": | |
# [{"name":"Apple HLS","outputs": | |
# [{"audio":[{"bitrate":48000,"sample_rate":32000,"codec":"AAC"}],"video":{"bitrate":1450000,"height":224,"width":400,"codec":"H.264"},"output_path":"/data/server/apple/apple_test_high.m3u8"}, |
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 'rubygems' | |
require 'bundler/setup' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new('localhost', 27017, :logger => nil).db('mongoid-test') | |
end | |
class A | |
include Mongoid::Document |
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
#!ruby | |
require "byebug" | |
require "yaml" | |
system("rubocop -R --auto-gen-config -ES") | |
system("git checkout .rubocop.yml") | |
todo = YAML.load_file(".rubocop_todo.yml") | |
todo.keys.each do |key| | |
puts "Fixing #{key}" | |
system("rubocop -a -R --only #{key} app config lib features spec") |