Skip to content

Instantly share code, notes, and snippets.

View deivid-rodriguez's full-sized avatar

David Rodríguez deivid-rodriguez

View GitHub Profile
production:
DB_NAME: ''
DB_USER: ''
DB_PASS: ''
test:
DB_NAME: ''
DB_USER: ''
DB_PASS: ''
model Token
include Mongoid::Document
field :user_id
end
model User
include Mongoid::Document
has_many :tokens
diff --git a/lib/byebug/remote.rb b/lib/byebug/remote.rb
index a782cfc..33d629c 100644
--- a/lib/byebug/remote.rb
+++ b/lib/byebug/remote.rb
@@ -1,96 +1,105 @@
require 'socket'
module Byebug
- # Port number used for remote debugging
- PORT = 8989 unless defined?(PORT)
@deivid-rodriguez
deivid-rodriguez / test_byebug_against_specific_ruby
Created March 20, 2015 17:46
Helper script to help git bisecting byebug
#!/bin/bash
# Source RVM as a function into local environment.
[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
# Compile and install Ruby
./configure
make && sudo make install
# Setup convenient variables
@deivid-rodriguez
deivid-rodriguez / Diff
Last active August 29, 2015 14:17
Problems with TravisLint in overcommit
diff --git a/.overcommit.yml b/.overcommit.yml
new file mode 100644
index 0000000..b265629
--- /dev/null
+++ b/.overcommit.yml
@@ -0,0 +1,19 @@
+#
+# Use this file to configure the Overcommit hooks you wish to use. This will
+# extend the default configuration defined in:
+# https://github.com/causes/overcommit/blob/master/config/default.yml
@deivid-rodriguez
deivid-rodriguez / chruby.diff
Last active August 29, 2015 14:17
wwtd chruby support
diff --git a/lib/wwtd/ruby.rb b/lib/wwtd/ruby.rb
index ead4876..fb41fb3 100644
--- a/lib/wwtd/ruby.rb
+++ b/lib/wwtd/ruby.rb
@@ -6,6 +6,7 @@ module WWTD
end
# - rvm: "rvm xxx do"
+ # - chruby: "chruby-exec xxx --"
# - others: env hash
@deivid-rodriguez
deivid-rodriguez / alarm.sh
Created December 15, 2015 00:24 — forked from bdjnk/alarm.sh
Bash Suspend Alarm Clock with Gradual Volume and Fallback
#!/bin/bash
__script_version="1.0"
#-----------------------------------------------------------------------
# Default values
#-----------------------------------------------------------------------
human_time="7 tomorrow"
@deivid-rodriguez
deivid-rodriguez / rubocoper
Last active November 17, 2021 13:19
Adds RuboCop to a project, one commit per cop
#!/usr/bin/env ruby
require 'open3'
#
# Adds RuboCop to a project, one cop per commit
#
class RuboCoper
def run
autocorrect_all
(restricted_collaborations) deivid@pantani ~/Code/decidim-module-crowdfundings $ bundle
Fetching gem metadata from https://rubygems.org/.......
Fetching https://github.com/decidim/decidim
fatal: No se pudo analizar el objeto 'ff36d24dbe1cf7aa99e5eeea1ff38e6aeeb2af92'.
Git error: command `git reset --hard ff36d24dbe1cf7aa99e5eeea1ff38e6aeeb2af92` in directory
/home/deivid/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/decidim-ff36d24dbe1c has failed.
If this error persists you could try removing the cache directory
'/home/deivid/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/cache/bundler/git/decidim-9495d3039168996748af12c0fdb04debdea10392'
(restricted_collaborations) deivid@pantani ~/Code/decidim-module-crowdfundings $ rm -rf /home/deivid/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/bundler/gems/decidim-ff36d24dbe1c/.git/