RSSAmplifier

Blog

LakTEK

Lakshan Perera's personal website

laktek.comRSS feed ↗128 posts

Latest posts

How I Use Claude Code with NeoVim

I use Claude Code a lot. Mostly as an assistant, rather than an agent (ie. a turn-by-turn approach rather than letting it run amok). I run a tmux window with split panes for each project. One pane runs NeoVim. The other has multiple splits running Claude Code, dev server, test watcher, etc. I often want to say things like "Address the FIXME comments in this file" or "Explain the function…

Modal dialogs without React (or JavaScript)

This is probably old news, but it went under my radar. This weekend, I was tinkering with a little hobby project and stumbled on MDN docs for <button> element . I noticed a relatively unfamiliar command attribute, which can take values such as "show-modal" and "request-close", among others. This led me to discover the native HTML <dialog> element , which is supported by all major browsers for…

Three weeks in Japan with a toddler

Early this month, my wife and I spent 3-weeks in Japan with our 3-year-old son. Our second son is only 10 months old and didn't join the trip. We felt it would be hard to keep up with his feeding and sleeping schedule with the intensity of the trip, so he stayed home with his grandparents. My wife and I believe that travelling is the best education we can give our children. This was our first…

Back to Personal Website

I was on paternity leave for the last couple of weeks, and in between diaper changes, I finally managed to redo my personal website. I first created laktek.com more than twenty years ago. The earliest snapshot in Wayback Machine is from 4th December 2001 . It was how I learned the ropes of web development, and blogging about my work helped me land some cool gigs early in my career. Sadly, it's…

What I learned building Page.REST

Last week, I released Page.REST - an API to extract content from any web page as JSON. It got 10 paid users within the first 24 hours, and it was just an idea I scribbled on paper 7 days ago. Here's why I built it and what I learned from it. I left Atlassian a year ago to bootstrap Pragma Labs. We've been focusing on building a modern CMS for web teams. While we had some early adopters, traction…

Next wave of SaaS

In my last post , I shared why I believe Trello's exit means we are coming to the end of the first wave of SaaS (software as a service). Before 2010, majority of us got into SaaS business by creating consumer facing apps. These apps were mostly replacements for traditional desktop software. Things have started to change in last 5-6 years. Computing has become ubiquitous. Software plays a part in…

End of the first wave of SaaS

This week, Atlassian acquired Trello for $425M . This is a massive win for Trello considering they have raised only $10M in funding . But I believe from an wider industry perspective this also confirms the end of the first wave of SaaS. First wave of SaaS was built on consumer facing web apps that took over the tasks done by desktop software or manual processes. Basecamp, Xero, SurveyMonkey they…

Introducing Pragma

I'm excited to share the details of my latest project - Pragma . This is an idea that was brewing in my mind for many years. If you were following my work four years ago, you might remember Punch . Pragma is an extension of Punch's vision, but with a completely rethought approach and execution. Static Pages FTW! I still believe static pages are the faster, secure and most cost-effective way to…

Going Independent

I was 16 when I first wanted to start my own business. I was living in Sri Lanka and just finished O/Ls (high school). Country was politically unstable and everyone knew war will start soon. Many of my friends were leaving the country. Some could afford to apply to foreign universities. Others were considering taking the risky and illegal routes. Two years before that I first read about the…

What I learnt at Atlassian

You don't have to be in Silicon Valley to build a great tech company. I hear this from lot of people. There are so many tweets, blog posts, podcasts and even books dedicated to this very belief. It's a convincing idea - you build a good product, use internet to sell it and you will have the reach and to customers all over the globe. Your location doesn't matter. Yet, you find only very few…

Adiós Nitrous. Sayonara Singapore.

Today is my last day at Nitrous. I feel a bit ashamed that this blog went into radio silent during the past two years. But that was mainly because I was busy having the time of my life. Couple of weeks ago, I was in Bangalore to speak at Gophercon India . After the conference, I met with one of my friends to take a stroll across the streets of Bangalore. We stopped at a greengrocer and another…

My First Three Months with Nitrous.IO

Last 3 months has been the most exciting and yet challenging period of my life. I migrated from Sri Lanka to Singapore to join with an early-stage startup called Action.IO . I first heard about Action.IO from HackerNews , somewhere around last July. It got my immediate respect as an engineering startup emerging from Asia. Also, it was solving a real problem. I felt it could change the way we code,…

The Next Generation is Here!

On January 1st, from the usual flow of new year wishes in my inbox, a special message stood out: Hi Aya did you use Html for coding websites ? i'm also coding websites but with Php Where did you host ur website ? did u host on ur own sever? It was from one of my cousins. I haven't seen him in 8 years. He was just a toddler when he migrated to France with his parents in 2004 just after the Tsunami.…

Revisiting JavaScript Objects

During the holidays, I spent some time catching up on the developments in ES6 (next version of JavaScript). While going through some of the proposals such as Minimal Class Definitions , Proxy API and Weak Maps ; I noticed most of these enhancements make extensive use of the object manipulation features introduced in ES5 (ie. ECMAScript5 - the current JavaScript standard). One of the main focuses…

End of a Chapter

Yesterday was officially my final day with Vesess Team. It was 2006. I was just out of college - spending most of the day lurking on local internet user groups. If my memory serves right, it was from this random discussion thread , I first stumbled upon Prabhath Sirisena and his blog, Nidahas (unfortunately dead now). Nidahas, aroused my curiosity in topics such as Web Standards, Open Source…

JSCamp Asia

Last week I was in Singapore, to attend JSCamp.asia . It was the first full-scale JavaScript conference to be staged in this region and was nothing less of the vibrant, insane spirit you expect from a JavaScript conference. JSCamp happened to be the first international conference I was selected to give a talk. My talk was titled "Embracing the Static Web". It touched on the challenges we face as…

Punch based Boilerplate to Power Your Blog

When I first created Punch , I didn't intend it to be used as a blogging tool. This blog was running on Jekyll during that time and I was content with the setup. However, as I was switching back and forth between Punch based projects and this Jekyll based blog, it became apparent how Jekyll's workflow misses the simplicity and intuitiveness I have in Punch. So I wanted a Punch based extension for…

Embrace the Static Web with Punch

This was originally published in the November edition of Appliness digital magazine. Remember the very first web sites we created? It was just bunch of HTML files that we uploaded to a remote host using our favorite FTP program. It was all static and it just worked. Yet it was boring. Visitors wanted sites that surprised them every time they hit refresh. Moreover, we also got tired by the slow and…

My Story of 1996 World Cup

Every Sri Lankan you meet today will have only one topic to talk. The T20 World Cup finals . You will hear them saying how Malinga can silence Chris Gayle, what makes Mahela the best captain in the game, why Sri Lanka couldn't win the cup on last 3 occasions and of course, why 1996 world cup victory was so special. No matter how hard you try, 1996 world cup victory will keep popping up in any…

Simple Helper to Extract Values from a String

While writing a blogging engine based on Punch , I needed to implement a way to extract values from a path based on a permalink pattern defined by the user. After writing a helper function to solve this case, I realized it can be useful in other similar cases too. So I extracted it to a its own package named, ExtractValues . Here's how you can use it: var extractValues = require('extract-values');…

Punch Reloaded

Punch started out as a simple static site generator, which I wrote to use in my own work. After releasing to the public, it attracted bunch of passionate early adopters, who provided some valuable feedback on how to improve it. Their feedback gave me a better perspective of what people really expect from a modern-day web publishing tool. So in last July, I took two weeks off from my day job, to…

Distraction Free Writing with Vim

I recently configured Vim to switch to a special writing mode upon opening Markdown files. It helps me to keep the focus while writing avoiding distractions. I first saw this concept in iA Writer and immediately fell in love with it. However, my muscle memory was too tied with Vim and I didn't want to switch to a different editing environment solely for this purpose. Hence, I tried to make Vim to…

SPDY for Rest of Us

There had been lot of buzz around SPDY lately, which is a brand new protocol introduced by Google to make the web faster. Most major browsers and web servers have begun to make releases with SPDY support. So I felt it's worthwhile to explore more about SPDY and how it matters to us as web developers. What is SPDY? The concept of world-wide web was developed on top of the HTTP protocol. It's an…

Punch Status - Instant Previews, Easy Publishing & More

It's been 2 months since I originally released Punch . I was encouraged from the initial feedback it received and ben commiting most of my free time to improve it further. In the past two months, Punch made lot of progress and there were several nice features added to the project. Punch focus on making a simple and better workflow to create, preview and publish websites. This new quick screencast…

Don't Fret Over Client-Side Rendering

Twitter is ditching client-side rendering and moving back to server-side . Does this mean client-side rendering is bad? Should we also move back to server-side? Well, it's insane to have FUD on client-side rendering just because it didn't work for Twitter (remember Rails can't scale ?). Rather, make it a lesson on how to use client-side rendering sensibly. "In our fully client-side architecture,…

Winning People with Code

Last Monday, myself and Laknath, met with Jervis and his lovely wife Himashini, for what it turned out to be the first unofficial meetup of Punch users. Jervis is an electrical engineer from Australia and he runs his own company, where he teaches Python to other electrical engineers (well, it was fascinating to know that our power plants are controlled from Python scripts). Jervis has been one of…

Rapidly Prototyping Web Applications with Punch

Process of prototyping a web application is two-fold. You will have to focus on the front-end, as well as the underlying data layer which powers it. Representation of the underlying data layer is what we usually call as the API. Front-end should know the types of data exposed by the API and also, API should know what data it should expose to the front-end. So it is essential to prototype these two…

Create Quick HTML5 Presentations with Punch

HTML5 presentations are cool and convenient. They just work in the browser and thanks to CSS3 & JavaScript they can be made to look even better than the traditional slides. It's easy to link to individual slides. Also, demos (if you're showing something related to web technologies) can done on the slides itself. There are already couple of good frameworks such as Google's HTML5Slides , deck.js and…

Punch - A Fun and Easy Way to Build Modern Websites

Few months ago, I switched this blog from Wordpress to Jekyll. I love how Jekyll allows me to prepare everything locally and simply publish when it's ready. There's no server-side logic involved, which means I can host the whole blog in a S3 bucket. Also, there's no more worries on mundane issues like security, performance or database corruptions. I wanted to have this freedom and control in any…

A Few cURL Tips for Daily Use

Though I knew cURL as a powerful tool; so far I never made an attempt to get familiar with it. Most of the time, I would just wade through its man pages to find a way get my stuff done. Recently I found myself make use of it for many of my daily tasks. By those excess usage, couple of recurring patterns emerged. If you are already familiar with cURL, you may not find anything interesting or new…

Learning Go - Functions

Functions are first-class citizens in Go. In the very first post of this series, we learnt that Go functions can return multiple values. Apart from multiple return values, there are several other interesting features in Go functions that's worth exploring. Higher-order Functions In Go, a function can take another function as an argument and also define a function as a return type. This feature,…

Learning Go - Interfaces & Reflections

In the post about Go Types , I briefly mentioned that Go provides a way to do run-time type inference using interfaces and reflection package. In this post, we are going to explore these concepts in depth. What is an Interface? Imagine you stop a random cab expecting to go from A to B. You wouldn't care much about the nationality of the driver, how long he's been in this profession, to whom he…

Stack on Go - A Wrapper for Stack Exchange API

Regular readers of this blog would know I've been spending my free time to learn Go . Today, I present you the first fruit of those learning experiences. Stack on Go is a wrapper library written in Go for Stack Exchange API . When I first stumbled upon the version 2.0 of Stack Exchange API, I felt it as one of the best API designs I've ever seen. So I decided to write a wrapper for it in Go, which…

Learning Go - Types

One of the main reasons I embrace Golang is its simple and concise type system. It follows the principle of least surprise and as per Rob Pike these design choices were largely influenced by the prior experiences. In this post, I will discuss some of the main concepts which are essential in understanding Golang's type system. Pre-declared Types Golang by default includes several pre-declared…

Different flavors of JavaScript

If you are programming with JavaScript, knowing about ES3 , ES5 & Harmony specifications and their usage will be useful. Here's a plain & simple explanation of them for your easy understanding. ECMAScript If we look into the history of JavaScript, it was originated from a side project of Brendan Eich called "Mocha". In 1995, it was shipped with Netscape browser as "LiveScript" and it soon renamed…

Learning Go - Constants &amp; Iota

When you learn Golang, your first encounter with constant declarations can be little confusing. type ByteSize float64 const ( _ = iota // ignore first value by assigning to blank identifier KB ByteSize = 1<<(10*iota) MB GB TB PB EB ZB YB ) Why only the first constant ( KB ) has a value assigned? What does iota means? These are some of the questions that could pop into your mind when you go through…

Learning Go

This year I'm going to try a new programming language - Go . I had this notion that compiled, type based languages are overly complex and reduces developer efficiency. However, after doing some reading about Go, it appeared to take a different path from the rest and felt like something worth trying. Acquainting a programming language is a journey. First few steps you take with it will define your…

Reviewing My 2011

It's almost the end of 2011. Now it's a good time to review how things went in last 12 months and make some resolutions to the next 12 months. From the start, I expected this to be a challenging year. This year, I turned 25 and was working full-time (no more formal education). So it was like moving on to a new chapter in life. From the beginning, I had few personal goals for the year. Here's a…

Sugarless - A Functional & Context Oriented way to write JavaScript

Fundamentally, JavaScript is a functional programming language. It's built with the concepts of higher-order functions, closures and lazy evaluations. It also has objects with protoypal inheritance. Unlike in Object Oriented languages, JavaScript's objects don't have methods. Instead, JavaScript executes functions in context of objects. When you call this inside a function it returns the reference…

After Graduation

One year after graduation, I hear many of my friends already reminiscing the days as an undergrad and about the freedom we had that time to live our lives the way we want . Yes, it was the time we never feared to put overselves against extreme challenges, found love at hopeless places and fought to change the world! But do we really lose this freedom to live our lives the way we want as we…

Basic Patterns for Everyday Programming

For most of you the patterns mentioned below should be nothing new. These are very basic stuff we slap into our code everyday and at times feels they are actually code smells than smart patterns. However, I've been doing some code reviewing lately and came across many code that lacks even these basic traits. So I thought of writing them down as a help for novice developers who would want to get a…

Why and How I Revamped My Blog

Update: I've migrated this blog from Jekyll to Punch. Here's the detailed blog post . If you are a regular visitor of my blog you will notice this has undergone a significant revamp (if you are new here, this looked similar to any other Wordpress blog). Actually, I've been working on this revamp for quite a some time and must say I'm really satisfied with the final outcome. There were several main…

Thank You, Steve!

It's still early morning here in Sri Lanka; I was just starting the day passively glancing over my Twitter feed. In a stream filled with rants over iPhone 4S' form factor and predications on how Siri is changing the world, seeing this tweet just shocked me. It feels like the passing of someone closer to my life. Yes, Steve was terminally ill, but who'd have thought it will come to him so soon? I…

Creating asynchronous web services with Goliath

Recently, I've been working on improving the performance of CurdBee API. There were certain highly consumable end-points which also had tight coupling to external resources. I wanted to extract these endpoints out of the main app to cut the cruft and improve the throughput. This require to turn them into bare-metal services which can utilize asynchronous processing. Weighing on the amount of code…

A Month in Vienna

I'm writing this post from 30,000ft above the ground, flying back home from Vienna. I came to Vienna last month, as per an invitation from GENTICS Crew (the company behind awesome Aloha Editor ) to hack on a really interesting project. I will not reveal much details about the project for now, since it's still little too premature for that (don't worry, you will get to hear lot about it in near…

Introducing jQuery Smart AutoComplete...

Few months ago, we did a major revamp in CurdBee UI. In this revamp we decided to make use of autocomplete on several data heavy inputs to improve the usability. We assumed any existing JavaScript autocomplete plugin could be easily modified to suit to our requirements. Unfortunately, that wasn't the case. None of those plugins were comprehensive and flexible enough to cover the cases we had in…

Understanding Prototypal Inheritance in JavaScript

Behavior reuse is one of the key aspects of Object Oriented programming. Many mainstream Object Oriented languages, achieves behavior reuse by using class based inheritance . In class based inheritance, a class defines how objects stemming from it should behave. However, not all languages use class based inheritance to achieve behavior reuse. The best possible example is JavaScript. It doesn't…

jQuery isBlank()

One of my favorite syntactic sugar methods available in Rails is the Object.blank? , which evaluates to true if the given object is false, empty, or a whitespace string. It makes your conditional expressions more readable; avoiding the use of boolean operators. It would be cool if we can have the same convenience when writing client-side code with JavaScript. Unfortunately, jQuery Core doesn't…

Looking Back at 2010

It was a year of transition in my life. Some of the highlights of 2010 were: Completed my degree and marked the end of formal education. Saw CurdBee becoming a more established product ( We shipped loads of new features in 2010). Completed another successful Google Summer of Code (probably my last) with OpenNebula project . Got to learn lots of new stuff (asynchronous processing, real-time…

Building Modular Web Apps with Rack &amp; Sinatra

Working on OpenNebula's Administration tool in last Google Summer of Code , was one of the best development experiences I had during 2010. The project has been successfully completed and awaiting to be released with a future version of OpenNebula. In this post, I would like to give some insights on its development, since I believe it stands as a good case study on how to build modular web apps,…