echo 'gem "newrelic_rpm"' >> Gemfile.d/newrelic.rb
# create config/newrelic.yml, copy from Newrelic site
RAILS_ENV=production bundle install
A more complete installation of Apache Flood (http://httpd.apache.org/test/flood/building.html)
svn co http://svn.apache.org/repos/asf/httpd/flood/trunk flood
svn co http://svn.apache.org/repos/asf/apr/apr/trunk apr
apt-get update && apt-get install autoconf libtool libxml2-dev make libapr1-dev libaprutil1-dev
./configure --disable-shared --with-libxml2
Stopped here, as I get errors when trying to compile.
I hope this helps someone.
|Pesos||Mb||Mb per peso||Peso per Mb||Days||Mb per Day|
* Prepaid only
- Prepaid have the best deal in terms of cost per MB with the newest GoSURF 50 promo. Useful if you need to upload/download in a pinch.
- GoSURF 499 is best value for money for 30 day plans.
- Because there’s a No bill shock protection cap on Php 1,500, it’s almost never worth getting the 1799 and 2499 plans.
Note to self:
Remove devise_for in routes.rb if you’re trying to generate a scaffold of an already existing model.
Steps to replicate:
- rails g model Foo name
- rails g devise Foo
- rails g scaffold Foo –skip
This would result with the error: The name ‘Foo’ is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
Commenting the devise_for line in routes.rb will allow you to proceed with the scaffold.
My 1 year old nephew got sick recently and it was an instant Php 10,000 ER trip. As I build my emergency fund, I sometimes get scared that I’m just 1 hospital trip away from starting back from scratch (or worse.) *knocks on wood*
I had 3 levels that I can cover: ER, Confinement and Health Maintenance.
I remember the last time I’ve had panic attacks. We were new to the work, and I knew about it in theory, but did not have first-hand experience with it. This was the first time, but I gave my 100% and researched the heck out of it but the client rejected our work.
I was devastated. As a result, I kept putting off having them check our work again. The project dragged on, and as a result, is delayed by a long time.
Oddly enough, I know that it’s all in my head. That failure in one thing isn’t really a failure if I learn from it and turn it into a success.
I know that. In theory.
I’ve tried to acknowledge the fear. Many times. By calling it out.
Nobody is perfect. You can make mistakes. You’re just scared.
But I guess I still need lots of practice.
While converting my tests from FactoryGirl.create to FactoryGirl.build_stubbed, I ran into trouble with Kaminari. Here’s how I fixed it.
Kaminari functions by adding .page() (and some other methods) at the end of your ActiveRecord call chain. A typical example of paginating via Kaminari is as follows:
class UsersController < ApplicationController def active_users @users = User.active_users.page(params[:page]) end end
This is a problem when you’re trying to stub out the return of the AR call to return an array. Here’s a corresponding test that would fail:
require 'test_helper' describe UsersController, "#active_users" do test "success" do users = FactoryGirl.build_list :user, 3 User.expects(:active).returns(users) get :search, term: "admin_user" assert_response :success end end
Because users is just a regular array here, and Kaminari tries to call .page() on the array, it would fail with a NoMethodError: undefined method `page’ for # because Array#page isn’t defined.
Trying to stub out .page() by
users.stubs(page: users) would give you ActionView::Template::Error: undefined method `model_name’ for #. And so on, as long as you’re using Kaminari-specific methods.
The solution is pretty simple (but took me 2+ hours to research). Call Kaminari.paginate_array on the FactoryGirl.build_list.
users = Kaminari.paginate_array FactoryGirl.build_list :user, 3
From the documentation:
Kaminari::paginate_array method converts your Array object into a paginatable Array that accepts page method.
For now, I’m putting the Kaminari.paginate_array inside the test, but long term, it makes sense to put it in the controller code. This way, even if we change User.active to return an array, no other code would break. Then again, that’s why we have tests, right?
After almost 2 weeks, my protein bars attempt #1 are finally done so I mixed up a new batch with the following recipe:
- 300g Quaker Oats Quick Cook Oatmeal
- 3 scoops Optimum Nutrition Double Chocolate Flavor
- 340g Ludy’s Sweet and Creamy Peanut Butter
- 250ml Surebuy Coconut Cream
This batch turned out better than last time. The consistency is closer to what I want. For now, this will be my go to recipe. I’ll probably play around with using a different brand of peanut butter and/or oatmeal.
As some of you probably already know, there was a fire at Prince David Condo, a building in front of Ateneo Friday afternoon.
What most of you probably did not know, my friends and I was there. We were at the top most floor, right below the roof deck.
Thankfully, we all survived.
Here’s our story, from my POV.