Skip to content

Instantly share code, notes, and snippets.

View fltiago's full-sized avatar

Tiago Ferreira Lima fltiago

View GitHub Profile
[{"id"=>371, "user"=>"renata", "message"=>"2.126 curtidas", "created_at"=>"2019-06-15T16:07:45.143Z", "updated_at"=>"2019-06-15T16:07:45.143Z"}, {"id"=>372, "user"=>"jp", "message"=>"2.060 curtidas", "created_at"=>"2019-06-15T16:07:46.643Z", "updated_at"=>"2019-06-15T16:07:46.643Z"}, {"id"=>373, "user"=>"renata", "message"=>"2.126 curtidas", "created_at"=>"2019-06-15T16:08:02.056Z", "updated_at"=>"2019-06-15T16:08:02.056Z"}, {"id"=>374, "user"=>"jp", "message"=>"2.060 curtidas", "created_at"=>"2019-06-15T16:08:03.226Z", "updated_at"=>"2019-06-15T16:08:03.226Z"}, {"id"=>375, "user"=>"renata", "message"=>"2.127 curtidas", "created_at"=>"2019-06-15T16:08:14.472Z", "updated_at"=>"2019-06-15T16:08:14.472Z"}, {"id"=>376, "user"=>"jp", "message"=>"2.060 curtidas", "created_at"=>"2019-06-15T16:08:15.702Z", "updated_at"=>"2019-06-15T16:08:15.702Z"}, {"id"=>377, "user"=>"renata", "message"=>"2.127 curtidas", "created_at"=>"2019-06-15T16:08:26.937Z", "updated_at"=>"2019-06-15T16:08:26.937Z"}, {"id"=>378, "user"=>"jp", "
/Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:453:in `read_buffer_length': Socket read 0 bytes. (Avro::IPC::ConnectionClosedException)
from /Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:398:in `block in read_framed_message'
from /Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:396:in `loop'
from /Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:396:in `read_framed_message'
from /Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:391:in `transceive'
from /Users/fltiago/.rvm/gems/ruby-2.2.1/gems/avro-1.7.7/lib/avro/ipc.rb:111:in `request'
from ./sample_ipc_client.rb:49:in `<main>'
@fltiago
fltiago / java.log
Created January 13, 2016 19:17
Java Server with Ruby client
java.lang.IllegalArgumentException: Illegal Capacity: -358941734
at java.util.ArrayList.<init>(ArrayList.java:156)
at org.apache.avro.ipc.NettyTransportCodec$NettyFrameDecoder.decodePackHeader(NettyTransportCodec.java:172)
at org.apache.avro.ipc.NettyTransportCodec$NettyFrameDecoder.decode(NettyTransportCodec.java:139)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:286)
at org.jboss.netty.handler.codec.frame.FrameDecoder.cleanup(FrameDecoder.java:337)
at org.jboss.netty.handler.codec.frame.FrameDecoder.channelDisconnected(FrameDecoder.java:230)
at org.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.java:399)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:608)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:102)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:676)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:691)
class UsersController < ApplicationController
def index
@users = User.all
end
end
# /views/users/index.html.erb
<%= users.each do |user| %>
<%= user.name %>
<% end %>
params do
requires :internal_reference, type: String, primary_reference: true, desc: "Internal reference"
end
post 'debug' do
present params
end
class PrimaryReference < Grape::Validations::Validator
def validate_param!(attr_name, params)
# code goes gere
@fltiago
fltiago / gist:6431427
Last active December 22, 2015 06:29 — forked from trcarden/gist:3295935
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
I, [2012-10-23T08:39:58.538847 #36521] INFO -- : Untied::Processor: processing event after_update from core with payload {:user=>{:languages=>nil, :gender=>nil, :friends_count=>0, :crypted_password=>"93cb231e482d795f1ee81ce41bf03bbb9d117da7", :avatar_file_name=>nil, :activation_code=>"3a96a528871660910c9e463211c0163f00aa9853", :current_login_ip=>nil, :created_at=>"2012-10-23T09:39:57-02:00", :birthday=>"1999-10-23T09:39:55-02:00", :updated_at=>"2012-10-23T09:39:57-02:00", :role=>2, :removed=>false, :oauth_token=>nil, :notify_messages=>true, :mobile=>nil, :avatar_id=>nil, :single_access_token=>"uVQR9zOAryIMItqG9LpD", :email=>"usuario2@redu.com", :persistence_token=>"ccb5769ae4e446bb13f9b7bd459375926ce86d5c6386a3f4a6f508cea46ecb6ab65fee46d17d3c8ebb7d6e2dad1782b67ee5ad19699aef8483c2a6c7b293aac0", :first_name=>"Usuário 2", :birth_localization=>nil, :avatar_updated_at=>nil, :activated_at=>nil, :zip=>nil, :login_count=>0, :password_salt=>"r9VdzRmoQjO7xtrBfbTt", :oauth_secret=>nil, :notify_followships=>true, :local
class AuthorObserver < Untied::Consumer::Observer
observe :user, :from => :core
def after_create(author)
debugger
puts "Usuario criado!"
end
end
describe Grape::API do
subject { Wally.new }
def app; subject end
...
context "GET wall by resource_id" do
context "when exist a wall" do
before do