kriwil logo

aldiantoro nugroho. @kriwil. indonesia. part-time programmer. full-time dreamer. swift. elm. linux. ubuntu. python. django. vim. indiana pacers. manchester united. random.

  1. Measure your tests coverage in Python ·

    Now you have tests in your project. But how can you be sure that the tests cover all the code (you need). It would be painful to find a bug because you didn't realize that part of code isn't tested yet.

    Coverage makes your tests useful. Do it.

    — – —
  2. Switch to Colemak for the sheer unholy joy of it ·

    Qwerty keys were not placed as a result of ergonomic considerations. Take the R key, for example. Colemak puts this on the home row. But in Qwerty it was moved to the top row. Why? To make it easier to peck out TYPEWRITER on a single row in sales demos by Remington reps. By accepting Qwerty, you are stuck in demo mode forever.

    He has the same opinion as I do. Switching to Colemak is fun!

    — – —
  3. Juno Progress for March ·

    As we steadily march towards Juno’s release (Ha! See what I did there?) new features are landing in our unstable daily builds on a regular basis. Juno is shaping up to be a great release for developers and other heavy keyboard users with the introduction of a few new tricks

    I've been using Elementary OS for more than a year now. I used to enjoy spending hours customize my Ubuntu look to my liking, but now I don't have time (or will) for that, so Elementary has served me well.

    — – —
  4. $169 development Chromebook ·

    Nearly every how-to and blog post I've found on "Chromebooks for developers" essentially starts with either: "Boot into Developer Mode" or "Install Debian/Ubuntu as the main OS". I'll just say it: This is bad advice. It would be akin to recommending that friends jailbreak their shiny new iPhone.

    The "right" to use chromebook for your development machine. It's definitely not all-purpose machine, but if it works, it works.

    — – —
  5. XDA Oblique ·

    XDA Oblique is a keyset inspired by the keycaps of the AEK, M0116, AEKII, and similar Apple keyboards.

    This is one beautiful keyset. I might have a reason to build another keyboard.

    — – —
  6. Dota2 vs League of Legends ·

    Both games have millions of active monthly players who play the game, but there is one clear winner. Dota 2 boasts around 13.5 million monthly active players as mentioned on their official blog statistics page. League of Legends on the other hand completely is definitely much more popular. From looking at the League player base, a few years ago the developers reported active monthly players of 67 million. Recently they announced LoL now gets over 100 million active players a month. That's a lot of players for an online game!

    TIL League of Legends player base is way bigger than Dota 2.

    — – —
  7. Colemak

    I've always wanted to type correctly. By that I mean touch-typing using 10 fingers and with finger on the right position. I got the touch-typing part nailed pretty good. The 10 fingers? Sort of. I'm pretty sure I'm using all my 10 fingers to type. Do I use it correctly? Now that's the concern. I don't think I do. And it's hard to change the habbit.

    I figured, if I wanted to change the habbit, I might as well learn new layout. Partly because I felt the muscle memory is easier to change if I learn new layout, partly because I just wanted it for the sake of it. I picked Colemak, because most of the GUI shortcuts (like ctrl+c, ctrl+v, you know, 2 most important shortcuts for progammer) stays on the same position (as in qwerty). So I changed my layout in OS level and started the journey. I put this image on my second monitor as cheatsheet. I also printed the image and put it next to my keyboard.

    colemak layout on hhkb

    I made a note about it on the first day, second day, and after a week. My firt day was on May 22, 2017.

    Day 1 was painful. My typing speed was probably 3-4 WPM. My second monitor was practically used to display the keyboard layout. Also, I had to switch between QWERTY and Colemak otherwise I won't be able to work at all.

    Day 2 was probably the same. My brain could figure out the key position, but my muscle couldn't. Could've been much better if I didn't switch back and forth. Alas, work needed to happen.

    Day 8. 22 WPM. That's an improvement. I realized something. A lot of shell commands I do come from muscle memory instead of remembering the command. So I kept hitting cd at the qwerty position. Also, I've been typing cd using the wrong finger the whole time.

    After that, the improvement is gradual. I think stopped switching back to qwerty after day 8. I was never a fast typer, so I don't really care about my WPM. Now, after more than 6 months, I feel I'm using my fingers correctly. Having an ortholinear split keyboard helps too, but that's another story for another time.

    So, answering the question you have, if you're using qwerty layout, should you learn new layout? The answer, IMO, is always no if you don't have any problem with it. If you have pain from moving you fingers, or you just want new challenge, go for it. It's fun.

    — – —
  8. Camel-case JSON Renderer for Django REST Framework

    Because I'm too lazy to create python package for this. Just use it.

    Django REST framework version: 3.5.x

    — – —
  9. Auto-publish pelican blog to S3 using CircleCI

    While having blog powered by pelican is great (because it's fast), creating new post isn't really fun. There are more than one step to do it:

    1. writing the actual post
    2. upload to the server (in this case, S3)

    If you're on new machine, it's even more painful:

    1. clone the repository
    2. install pelican's requirements
    3. setup S3 credential
    4. write the actual post
    5. upload to the server

    CircleCi has given free tier for a while now. So I figured, since I'm using github for my blog content, I could use it's free continous integration & delivery service to publish my blog easily.

    I found a blog post that gives instruction to do that, but apparently it doesn't work. s3cmd couldn't get the access key ID and secret access key I set. Since CircleCi has awscli preinstalled, it's better to use that one instead. Pelican doesn't support awscli yet, so there's some steps need to be done to use that.

    1. update your Makefile to use awscli instead
    2. insert your AWS S3 access key ID, and secret key ID
    3. create circle.yml in your repository

    Here's how the circle.yml should be:

        - pip install -r requirements.txt
        - echo -e "[default] \naccess_key = $S3CFG_ACCESS_KEY \nsecret_key = $S3CFG_SECRET_KEY \n" > /home/ubuntu/.s3cfg
        - echo "test"
        branch: master
          - make html
          - make s3_upload

    Now, everytime you push your commits to master, CircleCI will deploy them to S3. You should be able to see the deployment progress on you CircleCI dashboard.

    You don't need to create special environment to install pelican etc, just git and text-editor. You could even use github's feature to create blog post directly inside your browser (I wrote this using that!).

    new post via github

    — – —
  10. Windows 10


    It's been two weeks since I'm using Windows 10 for work, so I guess I could say something about it.

    I've been wanting to try to do (web) development on Windows for a while. I know this is weird, and sounds backward. But with Bash on Ubuntu on Windows, I had high hopes that I could finally have gaming machine and could still do development on it.

    The main reason I finally did this is I need to fix my work on IE/Edge. I usually use BrowserStack for testing IE (I still do), but it's very painful to use it for a long period of time. It requires a good upload connection, and in Indonesia, "good" and "upload connection" don't go together in one sentence. So when I had a hard drive lying around, I decided that it's finally the time to install Windows 10. I won't go to OS installation details, you'll find those kind of things easily in other places.

    The first thing I tried after installing Windows is that bash-thing. I was so exited that I could finally use real shell on Windows. Well it works. Sort of. It's slow, and other than running some shell commands, it doesn't do much. I can't even access the server I created using python -m SimpleHTTPServer command. Probably I need to do some magic thing first. But it doesn't work when I tried it, and I was disappointed.

    Once I found out I can't access that simple HTTP server, I didn't even bother to try full python web development setup. I immediately downloaded VirtualBox and Vagrant and setup the environment there. Maybe I should write another post focusing on development setup on Windows.

    There aren't many things I missed when working on Windows. My daily applications usages revolve around browser, IDE, terminal, todo manager, email client, notes taking application. From those list, I miss terminal and todo manager.

    Even I mainly use Safari, I do use Chrome for development, so that's not a problem. And with Chrome's sync, I don't even see any difference. All the bookmarks and extensions are there. I do miss 1password's auto fill, and sometimes it hits me hard.

    Powerful terminal (and shell) is probably the main reason why development on linux or OSX is better if you're not developing for Windows platform. Yes Windows now have PowerShell, and yes maybe it's good, but I doubt it's better.

    Now, the good thing about Windows. Steam. Games on Steam to be exact. Yes you could install Steam on linux or OSX, but there are lots of games that only work on Windows. And I've been enjoying games again. I don't always play games, but it's nice to have them ready when I want to.

    So, yeah, I guess Windows will mainly be a gaming system for me. I still hope the bash will works flawlessly in the future. In fact, I just turned the Insider Preview on so I could get faster updates, hoping there are more updates to the bash.

    I'm writing this on Windows, and will build this on bash (I'm using pelican), so if you see this paragraph, it means it's a success.

    — – —
  11. PC Build Update

    Thanks to some dude, I remember I need to post an update for my PC build.

    Since that post, I've gradually uppgrade some parts of the PC. I've increased the RAM to 12GB (8GB + 4GB RAM — now I have one 4GB RAM stick lying around. Want to buy? email me!). I also add Samsung EVO 250GB SSD (for OS) and 500GB Seagate drive (for backup). Somehow The water cooling system suddenly stopped working so I had it replaced with original heat sink, but I replaced the fan with Noctua NH L9I to keep it silent. I also added APC Pro 550 for UPS because electricity in Indonesia isn't that good.

    One think I regret from the build was the small case. I should've bought bigger one since now I don't have many GPU choices to go with the case. I don't have any plan to upgrade it now, but it'll be nice to have options for VR-ready GPU at somepoint in the future.

    — – —
  12. On Less Decission

    One less decision to make. That's what comes to mind when I saw the picture of Zuck's clothes. With that kind of clothes setup, there won't be any confusion on what to wear every morning. He probably just wakes up, takes a bath, and grabs any t-shirt there. Quick and easy.

    Options are always good. Options are liberating. Options open to many possibilities. But sometimes, options are overwhelming. Sometimes, options are distracting. Sometimes, less options is better. Sometimes, just pick whatever there's to pick is nice. And relaxing.

    I've been trying to reduce options in my life in order to keep my focus to things I actually want to do. This has been the one of the bases of why I choose what I choose.

    — – —
  13. Working While Standing, A Year Later ...

    Last August marks 1 year I work by standing. And I'm still rocking it ...

    It's started when was in Bali for work. I was wanted to try standing while working. People said it's good, so I just had to try it.

    The first week was pretty painful for my leg. While sitting for long hours is not good, standing for long hours isn't comfortable either. I found out that I had to move (walk, sit, or dance -- not that I ever did that, not in public) for few minutes every couple hours, to relax my leg.

    The second week was better. The pain was gone gradually, and sometimes I forgot that I've been standing for hours (although, that could the the workload talking :P). By the end of the second week, I was convinced that I should build standing environment at home.

    So I did. Originally, I just stacked few big boxes to put my keyboard and my monitor. Later I bought small open cabinet from ACE to put my keyboard and monitor. I still want to have real standing table. VARIDESK looks good. Too bad they don't ship to Indonesia. Custom built probably my best bet for this kind of thing.

    If I have to count, on busy day, I stand for probably 7-8 hours a day. I do rest every few hours. Usually on sofa watching TV for 10-15 minutes. I still have small chair that I use when I want to deep-think about something. I found that sitting is better for that kind of activity.

    So, couple tips from me if you want to have standing setup:

    • put a chair. good chair. or sofa. for thinking had stuff, sitting is better. also, you need to sit every few hours.
    • do not stand directly on hard surface. after few hours, your sole will hurt. I use thick mats for this.
    • the first few weeks will hurt. just bear with it. it gets better.

    I still want to have good sitting chair (for games, obviously).

    — – —
  14. Communication Tier

    There are many ways you could contact people these days. Email, text, instant messenger, phone call, randomly call people in the middle of busy street. You name it. If you're updated enough (and by that I mean using internet), I believe you could be contacted using at least two of those I mentioned above.

    But, how do we prioritize it? Surely contacting someone that you're having a baby won't be the same as contacting someone that you're cat is having a baby. I have some kind of communication tier that prioritize the ways you could contact me.

    So here's it, ordered from least urgent, to most urgent:

    1. twitter
      I don't check twitter regularly. Sometimes it could be couple a day, another time I check like once in two days. If you want really want my response, I won't suggest you contact me using this channel. DM might work as it will send email, but I don't always get DM emails, so don't rely to much on it.

    2. email
      I only check my email 2-3 times a day. If you could wait 1-2 days before you get any response from me, email is the best way. I will always try to reply emails, so if I haven't replied you email in 3 days, you could resend it just fine.

    3. whatsapp/skype/hangout
      I use them because everybody's using them, so I generally available on those platforms. I don't turn any notification on my phone though. I will usually response in few hours, depending on how often I check my phone. If you think you could wait up to 12 hours, go ahead.

    4. telegram
      I love this service because it's fast and it has clients in many platforms. If I'm not busy, I will response immediately, otherwise, it'll be couple hours if I'm in the zone. And I have the notification turned on for this app, because I only communicate with 5 people in this app, so it's not many.

    5. text/imessage
      This one actually stands on the same level with telegram, but if you could send me text with blue bubble, feel free to send it using this instead of telegram.

    6. phone call
      Please only use this if you want my response at that time. I answer calls most of the time (if I'm not on meeting), so please don't call for something I won't accept, like credit card offer or something like that. You'll go to blocked list instantly if you do that.

    I'm not suggesting I'm so busy that you should contact me accordingly. The fact is I'm not busy at all. I'm working from home, so I could finish my daily job and have a lot of free time. I'm just showing that I have reason why I haven't replied your emails or messages. Sending 2 emails in the range of 1 hour because I haven't replied it yet won't help.

    — – —
  15. DuckDuckGo

    I've been using DuckDuckGo as my main search engine for over 3 months now. I replaced the default search engine both in my phone and my computer. I thought it's time for me to write something about it.

    I don't have any specific reason other than one day I was unreasonably creeped out by Google because it showed my receipt in the search result. Obivously I knew the search result was crafted for my personal use, and the data wasn't publicly available and I shouldn't worry about it. But still, I finally had a reason to try DuckDuckGo.

    Overall, I don't think I missed anything. I always find what I am looking for. I never compared the result with Google, so I don't even know whether the result is better or worse. The fact that I mostly search about technical stuff helps too I guess.

    — – —
  16. The Podcast Renaissance

    Podcast is back! Well sort of. It never went away anyway. But sure it gets more popular.

    So, what is podcast? Quoting wikipedia:

    A podcast is a digital medium that consists of an episodic series of audio, video, digital radio, PDF, or ePub files subscribed to and downloaded through web syndication or streamed on-line to a computer or mobile device.

    I often use audio blog or video blog to explain what podcast is. After all, people know what blog is.

    I won't tell you about the history of podcast. I don't know when the first podcast was released, or which the first podcast is. I'm not interested in learning that history. You should be able to google your way to find those information.

    I'm here to tell you that you should listen to podcast. Especially if you're commuting. Especially if you're commuting for hours. Reading books is one of way to spend your commmuting time. But what if you're driving? I won't suggest reading books if you're driving your own vehicle. I might as well ask you to jump out of a cliff. So, listen to podcast instead.

    What should you listen? For a start, try Hello Internet and Serial.

    Hello Internet a generic tech/random stuff podcast, hosted by CGP Grey and Brady Haran. You'll enjoy it.

    Serial is probably the most popular podcast in 2014. Before serial, podcast is probably listened only by internet geeks. But now it reaches more people. This is why Myke Hurley of Relay FM called it a podcast rennaissance in is talk, "How I became an Independent Podcaster". It is indeed the perfect time for you to start listen to podcast.

    These are some podcasts I'm currently subcribing, in no particular order, excluding the two I mentioned above:

    — – —
  17. Assumption Driven Development

    Assumption driven development is when you develop based on assumption. While this might sound weird, I believe this practice happens almost every where.

    There are two kinds of assumption driven development. The first one is when some parts of the requirements aren't clear, and you, don't want to spend more time back and forth asking questions, decide to make an assumption on how stuff should work and move on with it. Sometimes you're right, sometimes you're wrong. Not a big deal. As long as you're under the deadline you're fine.

    The other one is not writing tests for your code and assume it's working because the documentation says so. This is a big no-no. No body writes perfect code. Not even you. I'm always a big fan of tests. No comment in the code? no problem at all. Shipping code without tests? There's a chance that I'll rewrite the code and write the test my own. Most likely because I don't understand the code.

    Code without tests is broken as designed —Jacob Kaplan-Moss.

    — – —
  18. On Learning New Technology

    Disclaimer: since I'm a programmer, by technology, I mean technology revolves around that. It may applies to others too though.

    How do you learn new tech? With all new stuff pops up every minute, at some point you'll have to learn new stuff in order to stay relevant. Let's face it, stop learning new stuff for couple years, you'll having problem finding works. And I don't even talk about Humans Need Not Apply-kind of irrelevant (which is great video by the way, you should watch it if you haven't. go. watch it. now).

    Learning new stuff is easy with internet. The resources are there. And you don't even need much time. 20 hours is all you need is all know enough. Yes, some said to be good at something, you need to spend 10,000 hours on it. But in the spirit of learning new stuff, those 20 hours are enough to get you started building something. Well, of course you shouldn't abandon it after 20 hours. You should reach the 10k hours if possible.

    And I haven't answer the question. So here's how I learn new stuff. I read, try, read, try, read, try, and ask. And read a lot. Most of the time, for whatever you're learning, there's already best practices, RFCs, READMEs you can (and should) follow. Sometimes it looks harder, but unless you have a very good reason to do it your way, don't. It's easier for others too, if you happens to work with other people.

    — – —
  19. Taking Break is Fun

    I love coding. It's fun. I code for fun. My best way to spend free time (aside from spending time with family, of course) is to code something. It could be anything. I'd never thought that I need another way to relax.

    Three days ago I took a break from computer stuff for couple days. I didn't check my email (this notification is still on though, just in case), IRC, feedly, I logged out from skype. Well I still opened twitter once in a while, but that's it. It was great. To not to thing about how to solve problems you have at work, what's the best way to do something, etc are very relaxing. I think I should do this more often.

    If you too enjoy your time at work and never tought of going away for vacation, you should try, at least once. You'll want to do more.

    — – —
  20. Building a PC


    It was fun, mini ITX case rocks! Check flickr for photos.

    the long story

    It's been a while since I built my own PC. It was 2007 IIRC. Then I bought laptops, becase my need was simple and portable device. I didn't need powerful machine because I only play Football Manager series.

    But then, I got a job developing stuff around edX. At first, I assumed my MacBook Air could handle the job. And it did. Barely. The edX Developer Stack requires vagrant (with virtualbox) with 2GB RAM. And the MBA struggled to survive. So I decided it's time for me to build another PC that will run linux.

    Of course, being a mac user for last few years, I should check the mac option first. The most important thing for the build is the RAM. I need at least 8GB of RAM. The best option is of course to go for the retina MacBook Pro. But that thing is out of budget for now, as my MBA still runs well without problem. The better way is buying Mac mini then upgrade the RAM to 8GB.

    Unfortunately we can't buy custom build mac in Indonesia. We could buy from Apple Store SG and send it to Indonesia (and hope it could pass the customs without problem), or build the base model and upgrade it immediately. Both options take times and I didn't have that.

    So here's my PC spec:

    Originally I went without the GPU (using onboard instead - intel HD 4600). It was fine until I played the application. It ran well, but not at the level I want it to run. So I bought the GPU a month later.

    I also didn't use the water cooling system when I built the PC. It was after I added the GPU, the temperature started to raise. As I'm using mini ITX case, using large heatsink is not an option.

    I chose mini ITX because of the size. I could put it on top of the table. And usually the mini ITX case design is good enough to be displayed.

    Building PC is fun, and building a mini ITX one is even more fun. You couldn't just drop everything and hoping it'll be ok. You'll need to manage the cables well so you could use the space optimally. Because temperature matters.

    So here I am. Using ubuntu again for working (and occasional StarCraft II — on windows — for fun).

    Also, check flickr for photos.

    — – —
If you have any comment, tweet me @kriwil.