// Richard Hart / Hates_

It’s never as bad as it seems

life

Nothing is ever as bad as it seems. There are only a handful of situations which are truly terrible. While I sit here and dred not making a shit tonne of money, there are people who have to worry about how they are going to shelter and feed their family, there are people facing certain death for their beliefs and views, there are people with absolutely nothing, with no hope and no prospect of ever changing that.

We should be eternally grateful for the things that we do have, because there is always someone else worse off. So when times seem hard and the road ahead difficult, remember those people worse off than us and let it spur us on to do the best that we can given the opportunities laid before us.

Read More

Going through the motions

life

Going through the motions is easy. It’s easy to go to the gym and move about a bit. It’s easy to turn up for work and put in the minimum neccessary. It’s easy to be busy and not really achieve anything. Day in, day out we go through the motions of life, blinded by the illusion of progress. But just because the wheels are turning it doesn’t mean we’re actually going anywhere. To get big and strong in the gym takes serious dedication constant pushing ourselves to the limit. To be successful at work takes going above and beyond what’s expected of us and delivering excellent work. Progress is the key. Are you better than you were yesterday? Yes? Good. No? Try harder tomorrow. Be aware of your current state and actions and be sure they are moving you forward.

Read More

It’s my data

computing, spree

Recently I’ve been working on migrating an existing e-commerce site from InstanteStore to Spree and have been having a nightmare of a time trying to get the client’s data out so that I can start the job of importing it all. The trouble is a lot of the information is not exportable, and whatever data is available is only half of what you would expect. It’s starting to make me angry because as far as I’m concerned that data belongs to my client, and to add insult to injury, to get access to certain parts of the data they want to charge extra money to “build an interface” to it.

I can understand on free to use sites like Facebook/Instagram/Tumblr/Whatever-Startup that the price of usage might be my data and that I might not be able to take it and go elsewhere with it, but when you’re paying for a service I expect to have full ownership and access to my information.

Read More

Adding a custom Spree payment Gateway outside a Rails Engine

computing, programming, rails, spree

Adding a new Payment Gateway to Spree through a Rails Engine is pretty straight forward as you can hook in your new gateway after the initial payment gateway array has been created. This is how the spree_gateway gem does it:


initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
    app.config.spree.payment_methods << Spree::Gateway::AnotherGateway
end

If you want to do the same thing for your own project contained gateway it’s a little different. If you try to just directly edit the payment_methods array in an initializer it will get wiped out when the Spree core engine sets the initial bogus and simple methods. I got around the problem by hooking my gateway in using the after_initialize method. Here I’m hooking in after SpreeGateway:


SpreeGateway::Engine.config.after_initialize do
  Your::Application.config.spree.payment_methods << Spree::Gateway::YourGateway
end
Read More

Vim – Join lines that end with a ^M (DOS carriage return)

computing, programming

Editing a CSV file which split whenever there was a DOS carriage return (^M). Joining up the lines was as simple as using the command below. To get the ^M char you use CTRL+V CTRL+M (don’t let go of CTRL in-between).


  :g/^M$/normal J
Read More