Blog (tips)

@fredwu 3 years ago (updated 11 months ago) | 10 min read | no comments
As coding bootcamps such as Coder Academy and General Assembly churn out more and more software developers, and as more and more people start to realise the importance of software, companies these days are facing an increased amount of candidates applying for junior dev roles. Recently we had to take down our job ad for a junior full stack React and Elixir role only a few days after posting it due to having received about 300 applications. Suffice to say, the competition is fierce at the entry-l...
@fredwu 4 years ago (updated 11 months ago) | 9 min read | 1 comment
Due to COVID-19, not many companies are hiring at the moment. The company I work for therefore is in a very fortunate position to still be thinking about growth and hiring. As a hiring manager for almost a decade now, I've personally reviewed thousands of job applications and CVs, and many hiring managers would probably agree, the vast majority of CVs are terrible. Let's change that! During COVID-19 where more and more people are either losing jobs or having their work hours cut, we are experie...
@fredwu 4 years ago (updated 11 months ago) | 7 min read | 3 comments
Over the past decade or two, both as a software developer and as a manager I have accumulated a few tips for becoming a better software developer. For context, I've been working as a software developer for more than a decade, mostly in small product-based companies; over the last decade or so I've worked as a team lead or manager in various capacities; and I've moonlighted as a consultant, freelancer and open source contributor in-between. Check out my LinkedIn profile and Github profile if you ...
@fredwu 12 years ago | 1 min read | no comments
Ever wondered how you could utilise the render method outside the context of Rails controllers and views? If you wonder why anyone would do that. Well, imagine you are building an awesome form builder, you need to output and/or store rendered partials in the buffer. How do you do that? For example, what if you want to do this in your view? <%=raw Awesome::FormBuilder.new(some_options).html %> You could do something like this: module Awesome class FormBuilder < AbstractController...
@fredwu 12 years ago | 5 min read | no comments
If you are looking at hiring developers, check out my article on this subject. The goal or the dream of working on your own startup is always full of excitement. And apart from some rare cases such as Dropbox, you probably need one or more co-founders to work with you on The Next Big Thing ™. Problem is, how do you (as a non-technical co-founder) find us? Or more specifically, how do you talk us into working with you instead of some other billion-dollar ideas? To answer this question, we need ...
@fredwu 12 years ago | 3 min read | no comments
If you are looking at finding technical co-founders, check out my article on this subject. In recent years developers become hotter and hotter - especially the good ones - they are hard to find, and they have plenty of employment options to choose from. Some companies (or individuals who are seeking freelancers) go the extra miles to impress developers with attractive salary/rate and perks, which is nice. But surprisingly, many companies and individuals seem to have a habit of keep doing things...
@fredwu 14 years ago | 1 min read | no comments
So you were wondering why some of your model attributes weren’t updating properly? Well, it is perhaps because the db schema has changed but the changed schema has not been passed onto ActiveRecord, as is often the case in DB migration. Taken from the ActiveRecord documentation: Resets all the cached information about columns, which will cause them to be reloaded on the next request. The most common usage pattern for this method is probably in a migration, when just after creating a table you ...
@fredwu 14 years ago | 1 min read | no comments
When you are getting an HTML string from an external source (e.g. from an AJAX get result) and you want to rip out a certain part of the HTML source, you need to make sure that the ‘certain part’ is not at the top level of the HTML source. For example, we have the following HTML string: Hello World If we want to get the first paragraph element by using: // data is the HTML source $('span#first', data) The above code won’t work, because the p tags are at the top level. Instead...
@fredwu 14 years ago | 1 min read | no comments
It was confirmed that DataMapper is incorrectly setting table names in SQL JOINs. So for instance, the following code would generate an SQL error: type.jobs.all(:"country.name".like => "%#{params[:location]}%") There is a workaround, however the workaround requires manual looping of the dataset thus produces N+1 queries. type.jobs.all.reject do |job| ! job.country.name.downcase.include?(params[:location].downcase) end But at least it works. ;)
@fredwu 14 years ago | 1 min read | no comments
It has been confirmed by DataMapper’s core developer Martin Gamsjaeger (snusnu) that it is a bug. In short, created_[at|on] can be manually overridden, but updated_[at|on] cannot. The workaround is simple, do it in two steps, for example: job = Job.create( title: "Web Developer", created_at: Time.now - 2 ) job.update!(updated_at: Time.now - 1) Please check the bug ticket to see when it’s getting fixed.