Open source survey application

Due to business requirements, I have forked and re-skinned a legacy PHP survey application with material design.

To give back to the community, here’s the updated source:

https://github.com/thanhphu/php-survey-builder

It contains the following improvements

  • Add material design for user-facing pages
  • Add appropriate ignore to avoid leaking credentials on source control
  • Add default user ID you can set via GET parameter when sending out mass email
  • Stricter .htaccess
  • More readable fonts

Troubleshoot running JMeter programmatically

Resolving “Could not find org.apache.jmeter:bom”

With the release of the v5 of the JMeter library comes a bug. When you include JMeter gradle will complain that it “Could not find org.apache.jmeter:bom”. To resolve this, edit build.gradle to say

// There's a bug in JMeter leaving extra metadata right now. This is a workaround
class JMeterRule implements ComponentMetadataRule {
    void execute(ComponentMetadataContext context) {
        context.details.allVariants {
            withDependencies {
                removeAll { it.group == "org.apache.jmeter" && it.name == "bom" }
            }
        }
    }
}

dependencies {
    implementation group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.3'
    implementation group: 'org.apache.jmeter', name: 'jorphan', version: '5.3'

    components {
        withModule("org.apache.jmeter:ApacheJMeter_core", JMeterRule)
        withModule("org.apache.jmeter:ApacheJMeter_java", JMeterRule)
        withModule("org.apache.jmeter:ApacheJMeter", JMeterRule)
        withModule("org.apache.jmeter:jorphan", JMeterRule)
    }
}

Application and apps for living in Korea

For Windows

This part is about little-known applications that fixes minor annoyances you may encounter as an expat in Korea. I’m pretty sure there’s more I didn’t know, if you do please leave a comment.

Blocks ads on Kakaotalk client

The ads on Kakaotalk for Windows can be a little overwhelming. You can apply this patch for download an application to hide those ads

Banking plugins

Internet Explorer is on its final breath… not in Korea! Similar to how they established a “Windows XP task force” after Microsoft stopped updates to the OS, I expect IE to live for a while longer on government and banking sites.

Installing the ActiveX those sites requires are one thing. You’ll find that what you had installed will slow down your computer or prevent you from accessing some website (yep). And uninstalling them one by one is a daunting task, sometimes even a Windows factory reset is faster.

The solution is “Hoax remover” (it’s an awkward name, but it works). This program will uninstall all those little ActiveXs for you, leaving you with a usable computer (at least until you need to install them again…)

Edit hangeul files

Universities love 한글, government love 한글, users don’t and they complain a lot that they have to fork out 40,000 won for a software that is inferior to Office.

Hancom decided that they had enough license money from the government so they released a public version of Hangeul that provides basic editing functionality so you can fill out forms and complete your homework. Though upon startup it will warn you not to use it for commercial purposes…

For Phones

List of apps that I find useful, not your typical list of map, food, talk apps that everyone already uses. Most will require a Korean number associated with your identity so get your ARC ready.

  • Toss use this to manage your bank account instead of the official bank apps. Especially useful if you have multiple accounts across multiple banks. Other functions: credit report, fingerprint fast payment, pay to account copied in clipboard…
  • Emergency ready app Don’t understand what the emergencies messages said because it’s in Korean? Turn of information notifications on your phone and install this app. It’s provide you with a translation of those messages
  • Annoyance report Your neighbor didn’t dispose of trash properly? Someone parked illegally blocking your way? Some public facility is broken? You can report those to the government and get a response in 1-2 days with this app

Just Awesome Vietnamese

In a moment of inspiration, I forked an abandoned awesome-vietnamese list and add some new entries to it. Hopefully this list will be useful for people looking for awesome Vietnamese projects

Assorted TILs

Difference between go get and go install

go install is part of the workflow when working locally. Say you want to use a library, but for some reason a change is required. You would do:

  • go get -d library, which only downloads it;
  • make the change on the downloaded package;
  • go install library to install the local version.

How to specify options for protoc

protoc -go_out=\

M{type1}={alias2},\

M{type2}={alias2},\

{option1}={value1},\

{option2}={value2}:\

{output path} {proto file}

How to use goproto_enum_prefix with GRPC plugin

protoc -I=. -I=$GOPATH/src/github.com/gogo/[email protected]/protobuf --proto_path="$dir" \

--gogo_out=\ Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\

Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\

goproto_enum_prefix=false,\

plugins=grpc:"$GOPATH/src"

How to create a type alias in go

package timestamp

import "github.com/gogo/protobuf/types"

type Timestamp = types.Timestamp

How to create a function alias in go

package ptypes

import "github.com/gogo/protobuf/types"

var TimestampProto = types.TimestampProto

var TimestampNow = types.TimestampNow

To publish a scoped package to npm @somethingsomething / packagename

  1. Create organization on npm ‘somethingsomething’
  2. npm login
  3. Edit package name to be @somethingsomething / packagename
  4. npm publish
  5. Profit!

To automate web tasks

Like finding elements on a page and click it, use Selenium IDE, available as a simple plugin for many browsers

How to type in Dvorak but keep Qwerty shortcuts

Every Dvorak user knows the pain: shortcuts in every program on earth is designed with Qwerty in mind. Cut – Copy – Paste is supposed to be next to each other but it’s not so in Dvorak.

As A Dvorak user, I’ve had to find and try many solutions for this problem over the years. It involved all sort of hacks and modifications to the deepest parts of the operating system: creating custom keyboard layouts, modifying the registry, write a new input method etc. Even so, it didn’t work in some applications (looking at you, IntelliJ, Java and Firefox – the bugs isn’t even fixed yet, and they are almost 10 years old!).

Almost 10 years later, in 2019, I finally found solutions that work for all major operating systems, and here they are:

MacOS

Apple makes great software, even though I don’t like their business practices, that’s an undeniable fact. MacOS is the simplest of the three OSes: Simply add Dvorak-QWERTY as an input method and you are good to go!

Windows

Used to be the second-easiest OS to work with, but recently Microsoft started cracking down on custom software and drivers so any custom keyboard layout not provided by them will get wiped out (and basically becomes very buggy with Windows 8 and up).

My solution? Use AutoHotKey! Yes, it’s an extra install, but it works reliably across all machines I’ve used with little setup required.

How to use Dvorak-QWERTY with AutoHotKey on Windows

  1. Install and set a Dvorak layout as your default (which language doesn’t matter)
  2. Install AutoHotKey
  3. Save this gist to your machine
  4. Optional: Convert the .ahk file to .exe with AutoHotKey so you can use it elsewhere without AHK
  5. Put the .ahk file in your startup folder
  6. Profit!

Notes about the AHK script

  • It will switch the layout to Qwerty when control keys or a combination of them is pressed (Ctrl, Alt, Win, Ctrl + Alt, Ctrl + Win)
  • It will disable itself when the input language is Korean (code = 68289554) so you can type Korean characters uninterfered. You can find similar code for Japanese, Chinese, etc. using AHK’s inspection tool
  • It will disable itself when scroll lock is on. This is for exceptional cases when you want to use Qwerty without pressing modifiers key
  • If you need additional combination of control keys, you must copy a whole section and add the control keys manually. For some reason, AHK’s * doesn’t work properly with control keys no there’s no way to make the script shorter

Linux

What worked for me: modifying the xkb keymaps! This idea came when I tried to replicate the AutoHotKey solution on Linux. I found source code of past projects that tried to achieve this. Sadly no step by step guide on how to apply them. Here’s how:

  • Press the plus button
  • Choose English (United States)
  • Choose any of the English (Dvorak-Qwerty), the flavor you prefer
  • Now switch the keyboard layout to your newly added layout
  • You’re done!

Conclusion

Dvorak is a good ergonomic layout but it hasn’t seen more widespread adoption due to entry barriers like the QWERTY shortcut problem. I hope this post solved part of that problem.