Skip to content

Instantly share code, notes, and snippets.

View felippemr's full-sized avatar
💭
Enjoying the ride

Felippe da Motta Raposo felippemr

💭
Enjoying the ride
  • Carta
  • Cupertino, CA
View GitHub Profile
@felippemr
felippemr / error
Last active August 29, 2015 13:55
undefined method `company_users_url' for
Processing by Admin::UsersController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"PIMHQq8QxfL+JFQoOhYwl9GNzGg9rHnyIud2/ws/SJE=", "user"=>{"company_id"=>"2", "username"=>"SOPAOS", "password"=>"[FILTERED]"}, "commit"=>"Create User"}
Company Load (0.7ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = 2 ORDER BY "companies"."id" ASC LIMIT 1
Unpermitted parameters: utf8, authenticity_token, commit
(0.2ms) BEGIN
User Exists (0.6ms) SELECT 1 AS one FROM "users" WHERE "users"."username" = 'SOPAOS' LIMIT 1
(0.3ms) SELECT COUNT(*) FROM "users" WHERE "users"."company_id" = 2
Company Load (0.3ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = $1 ORDER BY "companies"."id" ASC LIMIT 1 [["id", 2]]
(0.1ms) ROLLBACK
Redirected to
#!/usr/bin/env python
#
# Copyright 2012 by Jeff Laughlin Consulting LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@felippemr
felippemr / redis_info.rb
Created November 18, 2014 18:39
Redis info output plugin
module Fluent
class RedisInfo < Input
Plugin.register_input('redisinfo', self)
config_param :uri, :string
config_param :stats_interval, :time, :default => 60 # every minute
config_param :tag_prefix, :string, :default => "redisinfo"
def initialize
super
@felippemr
felippemr / cloudstack.js
Last active August 29, 2015 14:13
Meteor integration with cloudstack
var request = Meteor.npmRequire('request')
, crypto = Meteor.npmRequire('crypto');
cloudstack = function (options) {
if (!options) {
options = {};
}
var apiUri = options.apiUri || process.env.CLOUDSTACK_API_URI
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (https://rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: rails
gem install rails --debug -V
Exception `Errno::ENOENT' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:245 - No such file or directory - /Users/felippe/.gem/specs/rubygems.org%443
Exception `Errno::ENOENT' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:245 - No such file or directory -
Exception `Errno::EEXIST' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:245 - File exists - /Users
Exception `Errno::EEXIST' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:245 - File exists - /Users/felippe
Exception `Errno::EEXIST' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:245 - File exists - /Users/felippe/.gem
Exception `Errno::ENOENT' at /Users/felippe/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:287 - No such file or directory - /Users/felippe/.gem/specs/rubygems.org%443/latest_specs.4.8
GET https://rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL:
before_filter :update_sanitized_params, if: :devise_controller?
def update_sanitized_params
devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name,:email, :password, :password_confirmation)}
end
@felippemr
felippemr / gist:7792472
Created December 4, 2013 18:07
Uncaught ReferenceError: JQuery is not defined
<script data-turbolinks-track="true" src="/assets/jquery.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/jquery_ujs.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/turbolinks.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/bootstrap.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/projects.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/application.js?body=1"></script>
@felippemr
felippemr / gist:7792510
Created December 4, 2013 18:10
projects.js.coffee e project.js
JQuery ->
$('form').on 'click' , '.remove_fields', (event) ->
$(this).prev('input[type=hidden]').val(1)
$(this).closest('fieldset').hide()
event.preventDefault()
Depois de gerado ele fica assim:
(function() {
JQuery(function() {
@felippemr
felippemr / terminal_output
Created January 16, 2014 05:01
Invalid Authenticity Token
felippe$ curl -v -H 'Authorization' -d 'user="fraposo",password=teste' -X POST http://localhost:3000/api/sessions
* Adding handle: conn: 0x7f81a2803a00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f81a2803a00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 3000 (#0)
* Trying ::1...
* Trying 127.0.0.1...