GitHub activity

May 6, 2017
@aguzubiaga
  • @aguzubiaga 0c6a6c5
    use install_package for tmuxinator
May 6, 2017
@aguzubiaga
  • @aguzubiaga 2cc4761
    remove config files prior to link
May 6, 2017
@aguzubiaga
  • @aguzubiaga 3333849
    fix install_package function
May 6, 2017
@aguzubiaga
  • @aguzubiaga c469059
    use https for cloning dotfiles
May 6, 2017
@aguzubiaga
May 6, 2017
@aguzubiaga
May 6, 2017
May 2, 2017
Apr 24, 2017
@aguzubiaga
Apr 7, 2017
aguzubiaga commented on issue angular/angular#15825
@aguzubiaga

Same exact error! Does anybody knows a workaround?

Oct 21, 2016
@amuhle
Oct 12, 2016
@vairix-grodriguez

+1

Oct 12, 2016
@aguzubiaga
  • @aguzubiaga dc23eee
    Merge pull request #1 from nuxbit/db_service
aguzubiaga deleted branch db_service at nuxbit/nativescript-angularfire2
Oct 8, 2016
Oct 8, 2016
@aguzubiaga
Oct 8, 2016
@aguzubiaga
Implement initial database service
1 commit with 227 additions and 0 deletions
Oct 8, 2016
@aguzubiaga
Implement initial database service
1 commit with 227 additions and 0 deletions
Oct 3, 2016
Sep 30, 2016
@aguzubiaga

The exact same thing is happening to me (it even happens on the sample-groceries app), I'll try to downgrade and let you know what I got.

Sep 8, 2016
Sep 6, 2016
@amuhle
Aug 18, 2016
Aug 16, 2016
@amuhle
Aug 16, 2016
@amuhle
Aug 14, 2016
amuhle created repository amuhle/react-todo-list
Aug 14, 2016
Aug 14, 2016
amuhle created repository amuhle/react-boilerplate
Aug 14, 2016
Aug 14, 2016
@amuhle
  • @amuhleths 566efb6
    Adds testing and improves foundation styles
Aug 13, 2016
@amuhle
  • @amuhle af3c484
    Finalize tests & add page title
Aug 12, 2016
@amuhle
  • @amuhle 84fff06
    Update status to stop when count reaches 0
Aug 12, 2016
@amuhle
  • @amuhle 7b6afe9
    Wire app controls components
Aug 12, 2016
@amuhle
  • @amuhle 608104f
    Add static controls components
Aug 10, 2016
@amuhle
  • @amuhle 691cf43
    Adds test for countdown form
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
  • @amuhle 50eb8ce
    Publish 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
  • @amuhle f2a95ba
    Update 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
  • @amuhle fa739dc
    Publish 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
Aug 10, 2016
@amuhle
  • @amuhle f287555
    Update 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 10, 2016
@amuhle
  • @amuhle 594c29d
    Adds autopairs and javascripts plugins
Aug 10, 2016
@amuhle
Aug 9, 2016
@amuhle
Aug 9, 2016
@amuhle
amuhle created branch master at amuhle/react-timer
Aug 9, 2016
amuhle created repository amuhle/react-timer
Aug 9, 2016
Aug 9, 2016
@amuhle
  • @amuhle c2757bf
    Remove examples files and modifies readme file
Aug 9, 2016
@amuhle
amuhle created branch master at amuhle/react-weather
Aug 9, 2016
amuhle created repository amuhle/react-weather
Aug 9, 2016
Aug 7, 2016
@aguzubiaga

@borntodesign I understand, you can create an index of your items: { articles: { image: { article1: { ... } } }, articlesIndex: { article1: 'image' …

Aug 7, 2016
@aguzubiaga

@dowsanjack remember that your menu array items are now observables so you should access them like this: <h4 class="food-box-list-title">{{ (food |…

Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
  • @amuhle 35e40a7
    Publish 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
  • @amuhle 2c616c2
    Update 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
  • @amuhle 2c8c405
    Publish 2016-08-04-What-have-I-done-all-these-years.adoc
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle
  • @amuhle 1da5e96
    Update configuration file
Aug 5, 2016
@amuhle
Aug 5, 2016
@amuhle


StackOverflow activity

Answer by VAIRIX for How to make a discourse plugin available for public posts?

Disclosure: user @dariomac, the question owner, is part of our organization.

You have to skip the ensure_logged_in in the before_filter of the controller. Add something like this line to your plugin controller:

skip_before_filter :ensure_logged_in, only: :

Answer by VAIRIX for How to make a discourse plugin available for public posts?

Disclosure: user @dariomac, the question owner, is part of our organization.

You have to skip the ensure_logged_in in the before_filter of the controller. Add something like this line to your plugin controller:

skip_before_filter :ensure_logged_in, only: :

Answer by VAIRIX for reduce verbose jquery if else statement

I think that something like this, would be helpful to save up some lines of code in the js file.

  $("button").click(function () {        
    var a = '<'+this.innerHTML+'>';
    var b = '</'+this.innerHTML+'>';

    alert(a + 'put here the text to translate into our language. each one corresponds to a different alien dialect' + b);
  });

If you want to reduce the html to. I recommended to you that generate the buttons dynamically. You can generate an array as follow:

var array = new Array();
array['andromeda'] = '‡¦';
array['milkway'] = '¬';
array['alien-alpha'] = '¬y';
...

and then iterate for generate the buttons and append it to the html.

Answer by VAIRIX for reduce verbose jquery if else statement

I think that something like this, would be helpful to save up some lines of code in the js file.

  $("button").click(function () {        
    var a = '<'+this.innerHTML+'>';
    var b = '</'+this.innerHTML+'>';

    alert(a + 'put here the text to translate into our language. each one corresponds to a different alien dialect' + b);
  });

If you want to reduce the html to. I recommended to you that generate the buttons dynamically. You can generate an array as follow:

var array = new Array();
array['andromeda'] = '‡¦';
array['milkway'] = '¬';
array['alien-alpha'] = '¬y';
...

and then iterate for generate the buttons and append it to the html.

Answer by VAIRIX for Passing a child to container of parent type

The way I've solve this in my projects, is using instance_ofsome_class.individuals << student_instance.individual.

The thing here is that is not a real MTI, so your collection of individuals would accept only individuals instances. If you call some_student_instance.individual or some_professor_instance.individual, you'll get an individual instance which is related with your specific instance. Then working with that collection, if you want a Student or Professor all you need to do is call individual_in_collection.specific. For example:

p = Professor.create
a_model.individuals << p.individual
puts "#{a_model.individuals.first.class.name}"
=> Individual
puts "#{a_model.individuals.first.specific.class.name}"
=> Professor
Answer by VAIRIX for Passing a child to container of parent type

The way I've solve this in my projects, is using instance_ofsome_class.individuals << student_instance.individual.

The thing here is that is not a real MTI, so your collection of individuals would accept only individuals instances. If you call some_student_instance.individual or some_professor_instance.individual, you'll get an individual instance which is related with your specific instance. Then working with that collection, if you want a Student or Professor all you need to do is call individual_in_collection.specific. For example:

p = Professor.create
a_model.individuals << p.individual
puts "#{a_model.individuals.first.class.name}"
=> Individual
puts "#{a_model.individuals.first.specific.class.name}"
=> Professor
Answer by VAIRIX for Devise: User for subdomains

When you add the validatable module of devise in your model, automatically devise adds the follow validations:

 devise/lib/devise/models/validatable.rb

# All validations used by this module.
  VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of,
                  :validates_confirmation_of, :validates_length_of ].freeze


  def self.included(base)
    base.extend ClassMethods
    assert_validations_api!(base)

    base.class_eval do
      validates_presence_of   :email, if: :email_required?
      validates_uniqueness_of :email, allow_blank: true, if: :email_changed?
      validates_format_of     :email, with: email_regexp, allow_blank: true, if: :email_changed?

      validates_presence_of     :password, if: :password_required?
      validates_confirmation_of :password, if: :password_required?
      validates_length_of       :password, within: password_length, allow_blank: true
    end
  end

So, you could remove the validatable module and make your owns validations.

Answer by VAIRIX for Devise: User for subdomains

When you add the validatable module of devise in your model, automatically devise adds the follow validations:

 devise/lib/devise/models/validatable.rb

# All validations used by this module.
  VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of,
                  :validates_confirmation_of, :validates_length_of ].freeze


  def self.included(base)
    base.extend ClassMethods
    assert_validations_api!(base)

    base.class_eval do
      validates_presence_of   :email, if: :email_required?
      validates_uniqueness_of :email, allow_blank: true, if: :email_changed?
      validates_format_of     :email, with: email_regexp, allow_blank: true, if: :email_changed?

      validates_presence_of     :password, if: :password_required?
      validates_confirmation_of :password, if: :password_required?
      validates_length_of       :password, within: password_length, allow_blank: true
    end
  end

So, you could remove the validatable module and make your owns validations.

Answer by VAIRIX for Rails STI: How to change mapping between class name & value of the 'type' column

You can try something like this:

class Proyect < ActiveRecord::Base
end

Then the Indoor class but with Other name

class Other < Proyect
  class << self
    def find_sti_class(type_name)
      type_name = self.name
      super
    end

    def sti_name
      "Indoor"
    end
  end
end

The same apply for Outdoor class. You can check sti_name in http://apidock.com/rails/ActiveRecord/Base/find_sti_class/class

Answer by VAIRIX for Rails STI: How to change mapping between class name & value of the 'type' column

You can try something like this:

class Proyect < ActiveRecord::Base
end

Then the Indoor class but with Other name

class Other < Proyect
  class << self
    def find_sti_class(type_name)
      type_name = self.name
      super
    end

    def sti_name
      "Indoor"
    end
  end
end

The same apply for Outdoor class. You can check sti_name in http://apidock.com/rails/ActiveRecord/Base/find_sti_class/class

Comment by VAIRIX on Rails app crashes when config.eager_load=true
Have you tried to put <code>:require => false</code> to your engine in the Gemfile of the main app. By doing this, your gem would only be loaded when required instead of at boot time.
Comment by VAIRIX on Rails app crashes when config.eager_load=true
Have you tried to put <code>:require => false</code> to your engine in the Gemfile of the main app. By doing this, your gem would only be loaded when required instead of at boot time.
Answer by VAIRIX for Use where on has_many :through to find objects with 2 certain child object from different classes (Rails 4)

You need to do something like this:

User.joins(:carmodels).joins(:professors)
Answer by VAIRIX for Use where on has_many :through to find objects with 2 certain child object from different classes (Rails 4)

You need to do something like this:

User.joins(:carmodels).joins(:professors)
Comment by VAIRIX on Fixing git double-commit history
What comes to my mind is that you could make a change the commits order first to gather those who want to do the squash. To change the order you just got to swap the lines of the commit in the file that opens the git rebase -i. On the other side to see if the commits are equal or not, I would use gitg tool, to check the commits that have the same name and verify if those commits have the same changes. I don't know if there is any tool to automatically compare.
Comment by VAIRIX on Fixing git double-commit history
What comes to my mind is that you could make a change the commits order first to gather those who want to do the squash. To change the order you just got to swap the lines of the commit in the file that opens the git rebase -i. On the other side to see if the commits are equal or not, I would use gitg tool, to check the commits that have the same name and verify if those commits have the same changes. I don't know if there is any tool to automatically compare.
Comment by VAIRIX on Fixing git double-commit history
I don't understand your first question... can you explain me more detailed? Otherwise, to rename the commit, you have to use 'edit' instead of squash, save the file, and then git commit --amend. This open an editor and you have to save the file with the new name of the commit.
Comment by VAIRIX on Fixing git double-commit history
I don't understand your first question... can you explain me more detailed? Otherwise, to rename the commit, you have to use 'edit' instead of squash, save the file, and then git commit --amend. This open an editor and you have to save the file with the new name of the commit.
Answer by VAIRIX for Fixing git double-commit history

The command to accomplish that is:

git rebase -i HEAD~7

This will open up your editor with something like this:

pick f392171 Removed most clearfixs in templates
pick ba9dd9a Removed most clearfixs in templates
pick df71a27 Unew redirect logic
pick 79ce782 Merge branch 'develop' of github.com:xxx/xxx into develop
pick 1383070 Merge branch 'develop' of github.com:xxx/xxx into develop
...

Now you can tell git what to do with each commit. Let's keep the commit f392171, the one were we added our feature. We'll squash the following two commits into the first one - leaving us with one clean.

Change your file to this:

pick f392171 Removed most clearfixs in templates
squash ba9dd9a Removed most clearfixs in templates
pick df71a27 Unew redirect logic
pick 79ce782 Merge branch 'develop' of github.com:xxx/xxx into develop
squash 1383070 Merge branch 'develop' of github.com:xxx/xxx into develop

When you save and exit the editor, Git applies all two changes and then puts you back into the editor to merge the three commit messages:

# This is a combination of  commits.
# The first commit's message is:
Removed most clearfixs in templates

# This is the 2nd commit message:

Removed most clearfixs in templates

When done, save and quit your editor. Git will now squash the commits into one. All done!

Then you have to do

git push origin your-branch -f

to force your locally commits changes into remote branch.

Note: You have to do a squash to every duplicated commit.

Answer by VAIRIX for Fixing git double-commit history

The command to accomplish that is:

git rebase -i HEAD~7

This will open up your editor with something like this:

pick f392171 Removed most clearfixs in templates
pick ba9dd9a Removed most clearfixs in templates
pick df71a27 Unew redirect logic
pick 79ce782 Merge branch 'develop' of github.com:xxx/xxx into develop
pick 1383070 Merge branch 'develop' of github.com:xxx/xxx into develop
...

Now you can tell git what to do with each commit. Let's keep the commit f392171, the one where we added our feature. We'll squash the following two commits into the first one - leaving us with one clean.

Change your file to this:

pick f392171 Removed most clearfixs in templates
squash ba9dd9a Removed most clearfixs in templates
pick df71a27 Unew redirect logic
pick 79ce782 Merge branch 'develop' of github.com:xxx/xxx into develop
squash 1383070 Merge branch 'develop' of github.com:xxx/xxx into develop

When you save and exit the editor, Git applies all two changes and then puts you back into the editor to merge the three commit messages:

# This is a combination of  commits.
# The first commit's message is:
Removed most clearfixs in templates

# This is the 2nd commit message:

Removed most clearfixs in templates

When done, save and quit your editor. Git will now squash the commits into one. All done!

Then you have to do

git push origin your-branch -f

to force your locally commits changes into remote branch.

Note: You have to do a squash to every duplicated commit.

Comment by VAIRIX on set css value with variable and unity
You need to concatenate the values. Something like this: t_number+'em'.
Comment by VAIRIX on set css value with variable and unity
You need to concatenate the values. Something like this: t_number+'em'.
Answer by VAIRIX for set css value with variable and unity

This should work:

var t_number = '3em';
$("#spacing #text_content").css("letter-spacing", t_number);
Answer by VAIRIX for set css value with variable and unity

This should work:

var t_number = '3em';
$("#spacing #text_content").css("letter-spacing", t_number);
Comment by VAIRIX on RSpec routing spec fails for custom match
Could you say me your rspec version?
Comment by VAIRIX on RSpec routing spec fails for custom match
Could you say me your rspec version?
Answer by VAIRIX for Joining a table and a filtered table in ActiveRecord

You can do something like this:

Song.joins(:albums).where('albums.released_on >= ?', from).where('albums.rating > ?', rating).where('albums.genre = ?', genres)

It makes only one query.

Answer by VAIRIX for Joining a table and a filtered table in ActiveRecord

You can do something like this:

Song.joins(:albums).where('albums.released_on >= ?', from).where('albums.rating > ?', rating).where('albums.genre = ?', genres)

It makes only one query.

Answer by VAIRIX for In Rails 4 using AJAX, how do I update a particular div on success?

This should work for you:

html = render_to_string(partial: 'images', locals: {user: user})
Answer by VAIRIX for In Rails 4 using AJAX, how do I update a particular div on success?

This should work for you:

html = render_to_string(partial: 'images', locals: {user: user})
Comment by VAIRIX on How to implement root route and get "index" to the same page
You can add root to: 'static_pages#index' inside or outside your scope. It's a possible solution and maybe doesn't fit what you expect, cause it takes more code to solve the problem.
Comment by VAIRIX on How to implement root route and get "index" to the same page
You can add root to: 'static_pages#index' inside or outside your scope. It's a possible solution and maybe doesn't fit what you expect, cause it takes more code to solve the problem.
Answer by VAIRIX for How to implement root route and get "index" to the same page

A possible solution that implies more than one line, is using scope to make it cleaner, you will have two extra lines of code, but I found it more readable:

scope :path => '/', :controller => :static_pages do
  get 'index' => :index, :as => 'index'
  get 'home' => :index, :as => 'home'
end

That way you make explicit which controller to use for all routes + the path (first part of it).

Answer by VAIRIX for How to implement root route and get "index" to the same page

A possible solution that implies more than one line, is using scope to make it cleaner, you will have two extra lines of code, but I found it more readable:

scope :path => '/', :controller => :static_pages do
  get 'index' => :index, :as => 'index'
  get 'home' => :index, :as => 'home'
end

That way you make explicit which controller to use for all routes + the path (first part of it).

Answer by VAIRIX for I don't really know what RSPEC assigns do, and my tests are failing

What you should expect from the assign after calling your controller, is to have the value that the controller sets to the instance variable. You could see it like using @category. So the category created with FactoryGirl is not equals to the one created by your controller (in this case seems your action is returning nil value in your instance variable)

Answer by VAIRIX for I don't know what RSpec assigns does, and my tests are failing

What you should expect from the assign after calling your controller, is to have the value that the controller sets to the instance variable. You could see it like using @category. So the category created with FactoryGirl is not equals to the one created by your controller (in this case seems your action is returning nil value in your instance variable)

Comment by VAIRIX on How to let the user create cron jobs in rails?
If you want to schedule a task every X period of time, and your user only sets when and the task (as you said), you could try doing it with delayedjob ` class.delay(run_at: 5.hours.from_now).method(param)` and call recursive in the method. Of course you will have some delay of excecution (even if the first thing in your method is calling the recursion). It should be some similar way to do it with Sidekiq (really don't know). Be careful with overlapping of tasks.
Comment by VAIRIX on How to let the user create cron jobs in rails?
If you want to schedule a task every X period of time, and your user only sets when and the task (as you said), you could try doing it with delayedjob ` class.delay(run_at: 5.hours.from_now).method(param)` and call recursive in the method. Of course you will have some delay of excecution (even if the first thing in your method is calling the recursion). It should be some similar way to do it with Sidekiq (really don't know). Be careful with overlapping of tasks.
Answer by VAIRIX for Select objects based on grandchild attribute with joins in ActiveRecord

This should be work!

Foo.joins(:bazs).where(bazs: {name: 'x'})
Answer by VAIRIX for Select objects based on grandchild attribute with joins in ActiveRecord

This should be work!

Foo.joins(:bazs).where(bazs: {name: 'x'})
Comment by VAIRIX on Use form to send ajax request to rails app
If you need more params from the view, just add them in the "data ajax attribute" like data:{ rows: val1, sort: val2 }
Comment by VAIRIX on Use form to send ajax request to rails app
If you need more params from the view, just add them in the "data ajax attribute" like data:{ rows: val1, sort: val2 }
Answer by VAIRIX for How can I display png data as an image inside in the browser?

One way to do this, is by doing the following: In the view

<img src="/get_img/tlotr">

That will make a request to the server, so in the routes.rb add

get '/get_img/:filename' => 'test#img'

In my case I have a TestController with an action call img like:

def img
  send_file( "/your_path/#{params[:filename]}.png",
    :disposition => 'inline',
    :type => 'image/png',
    :x_sendfile => true )
end

With this solution you hit the server one more time, but you don't have to send the data using the read method.

Answer by VAIRIX for How can I display png data as an image inside in the browser?

One way to do this, is by doing the following: In the view

<img src="/get_img/tlotr">

That will make a request to the server, so in the routes.rb add

get '/get_img/:filename' => 'test#img'

In my case I have a TestController with an action call img like:

def img
  send_file( "/your_path/#{params[:filename]}.png",
    :disposition => 'inline',
    :type => 'image/png',
    :x_sendfile => true )
end

With this solution you hit the server one more time, but you don't have to send the data using the read method.

Answer by VAIRIX for Use form to send ajax request to rails app

You can do something like that:

In your javascript file:

$('#my_button').click(function(){
  $.ajax({
    type:'GET',
    url: '/table',
    data:{ rows: $('#my_text_field').val() },
    success: function(data){
      $('#my_table_container').html(data);
    }
  });
});

In your controller:

def table
  render partial: 'table', locals: { rows: params[:rows] }
end

In your routes.rb:

match 'table' => 'your_controller#table'

And then in your partial (_partial.html.rb), you have to iterate over number of rows that you receive in the rows param.

Answer by VAIRIX for Use form to send ajax request to rails app

You can do something like that:

In your javascript file:

$('#my_button').click(function(){
  $.ajax({
    type:'GET',
    url: '/table',
    data:{ rows: $('#my_text_field').val() },
    success: function(data){
      $('#my_table_container').html(data);
    }
  });
});

In your controller:

def table
  render partial: 'table', locals: { rows: params[:rows] }
end

In your routes.rb:

match 'table' => 'your_controller#table'

And then in your partial (_partial.html.rb), you have to iterate over number of rows that you receive in the rows param.

Answer by VAIRIX for Helper for controller and views

Define it in the ApplicationController like:

class ApplicationController < ActionController::Base

  helper_method :paypal_url

  def paypal_url
    'https://www.paypal.com/cgi-bin/webscr'
  end

end

After that you'll be able to use the helper method from any view or controller.

Answer by VAIRIX for Helper for controller and views

Define it in the ApplicationController like:

class ApplicationController < ActionController::Base

  helper_method :paypal_url

  def paypal_url
    'https://www.paypal.com/cgi-bin/webscr'
  end

end

After that you'll be able to use the helper method from any view or controller.




What's going on?


How to contact us

Our Location

DireccionArismendi 1420 Of. 102 Telefono(+598) 2409 15 66 Mailinfo@vairix.com

Follow us


Want to contact us?