What does it take to be a visionary product leader with an entrepreneurial mindset? That is a question I spend most of my time thinking about these days when working for the company I co-founded, Lean Forward.
Category Archives: Software
Where to find me
Not writing very much here these days. You’re better off finding me at Startup Studio or LinkedIn.
HTTP 403 Permission denied due to error “unable to check htaccess file”
Added some new icons to a site I was building but they refused to load. I got a HTTP/403 (permission denied) error on the files. When I looked in the apache log file I saw the following.
[Sat Oct 18 08:56:54 2014] [crit] [client 127.0.0.1] (13)Permission denied: [...]/public/assets/img/icons/social/cuteicons/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
The problem was, the only directory with a .htaccess file was the root directory of the website. What was wrong? Well, it turns out the directories the icons were in had the wrong permissions set. I hade copied an unzipped folder directly in to my web site. In order for apache to work properly every directory has to have the execute flag set.
So, after a…
chmod 755 /folder/name
…the icons loaded as they should.
AngularJS and IE8, directive that compiles HTML
I have a directive that loads an article in HTML from a CMS via a REST API and a template file what should be compiled together with the article.
element.html(templateLoaded.data);
scope.document = theLoadedArticle;
$compile(element.contents())(scope);
This worked in most browsers except our old “friend” Internet Explorer 8. The reason is I have another directive in the loaded template file and I need to tell the DOM compiler about this (IE8 is cranky about non-html tags).
So, inside the template file I added:
<script type="text/javascript">
//Needed for IE8/9
document.createElement('my-directive');
</script>
Now it works. It could probably be done outside the template file as well.
WordPress, Drupal or Roll Your Own?
When should you use existing CMSs as WordPress or Drupal and when should you build one yourself?
Of course, building a CMS from scratch would be insane but with emerging technologies and standards such as git (for version control), Markdown (for editing), Neo4J (for metadata) and Solr or ElasticSearch for indexing the data, you can get extremely far by putting the pieces together yourself.
Add to that the recent rise in popularity of Javascript frameworks such as AngularJS or Backbone, with which you tend to get a cleaner split between REST-API and UI, and you don’t even have to render the web pages on a server. Static HTML-files with Javascript are fine.
So maybe the time has come to say goodbye to the web CMS that tries to do everything and say hello to a toolbox of world class, open source and free components that you put together yourself to build a framework?
Subversion (svn) error: “containing working copy admin area is missing”
Accidentally tried to add a folder to an svn repository with files that were already added to another svn repo. This caused some confusion for subversion and I got the error message:
containing working copy admin area is missing
This SO question saved me: The solution is to do:
svn --force delete _dir_
On the directory.
John Carmack on Software Engineering
A very good read here from game programming legend John Carmack.
In reality in computer science, just about the only thing that’s really science is when you’re talking about algorithms. And optimization is an engineering. But those don’t actually occupy that much of the total time spent programming. You know, we have a few programmers that spend a lot of time on optimizing and some of the selecting of algorithms on there, but 90% of the programmers are doing programming work to make things happen. And when I start to look at what’s really happening in all of these, there really is no science and engineering and objectivity to most of these tasks. You know, one of the programmers actually says that he does a lot of monkey programming—you know beating on things and making stuff happen. And I, you know we like to think that we can be smart engineers about this, that there are objective ways to make good software, but as I’ve been looking at this more and more, it’s been striking to me how much that really isn’t the case.
The whole post is worth a read.
Drupal 7 Youtube videos as fields in content type
I have been doing quite a lot of work with Drupal 7 the last couple of months. It has its ups and downs but one thing that it always tries to do is to prevent you from having to write your own code to solve problems.
It gets quite annoying then when simple things don’t work. In my case I wanted a content type with nothing but a title and a video field that shows Youtube videos that the editor pasted the URL to. That should work, right?
Well, yes, it should, but not without problems. First, I installed the Media module and then the Media:Youtube module. I set up a content type with a field of the type Multimedia Asset.
Then comes the kicker: without doing the following things didn’t work. The videos didn’t show up at all. It took me quite some time to figure this out.
At the Manage Display tab I had to first remove the video (make it Hidden) and then add it again so that I could choose a file view mode. See screenshot below.
The display types are defined in Config > File Types > Manage file display. Here I can choose Youtube video and after making sure the content type chooses a file view mode the video was displayed. *phew!*
Lean Startup Books
Speaking of books, I just set up a new blog focused on books about lean startup.
In case you don’t know, a lean startup is an organization in search of a scalable business model. It is heavily influenced by the agile software movement. (I even wrote a manifesto for it! 🙂
So far, I’ve only added four books but I will add more later and also categorize the books into sections such as software development processes, good living, marketing etc.
These are basically the books I’m reading myself so I thought I might as well collect it all and put it on a web site.
Programming books
There was a thread on Hacker News about influential books for programmers. I wrote a comment which I might as well rewrite for this blog because it’s an interesting subject.
So… the answer to this question depends a lot on in what stage of programming maturity you are.
The thing is, I remember the exact moment I “got” what a class in C++ was. It was a true relevation. Even though I had been programming for a few years (on my Commodore 64 and Amiga – mostly BASIC and some assembler) it wasn’t until I was 19 that I fully understood the concept of a class.
I can definitely say that I was a different programmer after that day. It was like leveling up in an RPG.
It took me a few more years to get object oriented design…
Yeah, maybe I’m a slow learner (although I have seen enough of other people’s code to conclude that I’m not alone) but the point is that at different stages of my journey to learn the programming craft I have been open to different ideas and insights.
I don’t think there’s one book that alone would have taken me all the way. The right book at the right moment can push you over a cliff of insight but software development is truly a craft of the mind and it takes many years to be really good at. I’m not there yet.
What’s your favorite programming books?