Tuan Anh

container nerd. k8s || GTFO

Hydra - an open-source window manager for OS X written in Lua

Open-source, written in Lua

Gotta try this.

Update: Hydra was renamed to mjolnir due to trademark issues

link bài gốc

Clean code/dirty code

I like to think of myself as a perfectionist. I like going back and forth re- evaluate all the possible options and come up with the cleanest, best, perfect alternative (I can think of) out there. If you are like me and you got to maintain someone else’s bad code, this is gonna be a real nightmare. You just want to scratch everything and start over again. Unfortunately, management people doesn’t think so and you don’t get the luxury of times you need. All they want is you get it fixed and ship the product as soon as possible.

I thought it is what makes me a better developer but in the end, getting a shippable product is what matters.

Sometimes, it’s just better to use a bit of dirty, tricky code to make it works. Sometimes, you just need a bit use of dirty code if it is what it takes to get the product out of the door.


How to use SSH tunnel to access blocked websites

Requirements

  • An UNIX server/VPS (since it’s cheaper than Windows server/VPS). Lowest package would probably do. Location: not in the the same area/country as you.
  • A little copy/paste skill. No Unix commands knowledge required.

Howto

  • If you’re on Unix/OS X, open Terminal app and issue the command
ssh -D 1080 [email protected]_or_domain

This command will connect to your server/VPS using ssh and open a ssh tunnel on port 1080 of your computer. Setup your browser/OS to use localhost:1080 as socks5.

All the traffic will be sent over ssh tunnel hence your ISP will only see it as you’re accessing your server/VPS.

If you’re on Windows, you can grab Tunnelier (free). The setup is pretty straight forward.


How to code like a dick in JS

The goal of this post is to make simple things look complicated.

1. Invert logic

Let’s start with something easy.

Instead of

if (x && y) { ... } // easy

Write this instead

if (!(!x || !y)) { ... } // good enough

2. Extended unicode chars for variable names

Use of extended unicode chars, especially those that are not visible in console like \r, \t, etc…

3. Use = instead of ==

if (x=true) { ... } // always executed

Do this when you want to always excute that code block. Someone may see this and will attempt to “fix” it on their own, changing the original logic. Goodluck debugging it later : )

4. Use 8-base or n-base instead of decimal base

Because why not?

var x = 19;   // 19
var y = 019;  // 17

Programming is like writing a book

Programming is like writing a book… except if you miss out a single comma, the whole thing makes no damn sense.

On why programming is hard.


Matias Laptop Pro review

I love my HHKB. I love its form factor. It’s perfect, except that it requires a mini-USB cable to connect to my Macbook which isn’t very convenient.

The Matias Laptop Pro is the perfect addition to my keyboards family: it’s wireless, small and handy.

Matias Laptop Pro

Design

Let’s take a closer look at the Matias Laptop Pro.

There isn’t much change to the case compare with other Matias keyboards. It’s quite solid but the the feeling is not as good as the HHKB or Filco.

The case is made from Injected Policarbonate (used in football helmets) which is more resistant than other commonly used, cheap ABS plastic. It’s bit too glossy for my taste and a horrible fingerprint magnet (it’s not deal breaker to me though).

The Laptop Pro is a bit bigger in size, much less handy and quite heavier when compare with the HHKB Pro 2. It’s the smallest form Matias is offering for now but I heard they mentioned about working on a 60% board.

The keyboard has 2 rubber feet but still a bit slippy and easily get slided on the table.

Switches

It’s very quiet. Much quieter than any switches I’ve ever owned or tried before. The tactile bump is quite nice but not as noticable as the Tactile Pro. This is a trade off for being quiet I guess.

I’ve tried Brown MX keyboards and I have to say Matias quiet switches are definitely quieter, even if you do bottoming out everytime.

Layout

A bit hard for me as I get used to the HHKB layout with the Ctrl key at the Caps lock position instead. I may have to reassign the key as I keep mistakenly holding Caps lock + Tab for tab switching in Chrome.

Also, the Fn key next to arrow keys choice is an interesting choice, though I do not need to use Fn as often as I do to on my old HHKB.

Keycaps

Unfortunately I haven’t found a single place that sell custom keycaps for Matias quite switches yet. You’re stucked with the default one.


If you are already spoiled by the mechanical keyboards and don’t want to settle for less when you’re on the go, this keyboard is for you. It’s small, quiet, lightweight enough to carry around plus no more cable, thanks to the Bluetooth connection.

  • A side note: I expect the keyboard to continue functioning if the charging cable is used and Bluetooth is off. Well, it doesn’t. I don’t know about the technical difficulty to make it work though.*

Cakebrew

A Mac app for Homebrew

Not sure who’re the target users for this app as most of those who want to tinker with Homebrew formulas are probably not afraid of learning a few terminal commnads.

Still useful nonetheseless.

link bài gốc

How to install Discourse on DigitalOcean

Zero knowledge about Ruby, Rails or Linux required.

link bài gốc

Tự do ngôn luận

Con trai hỏi bố: - Bố ơi, tự do ngôn luận là gì hả bố?

Bố: - À, là ngay cả 1 thằng ngốc cũng được quyền phát biểu con à.

Con trai: - Vậy không có tự do ngôn luận là sao?

Bố: - Là nơi đó chỉ có những thằng ngốc mới có quyền nói.

Con trai: - ???

Rất đơn giản và dễ hiểu phải không? :)


Be happy

Elizabeth Smart has the kind of fame no one would want: In the summer of 2002, at the age of 14, she became one of the nation’s most famous kidnap victims when she was abducted from her bedroom in Salt Lake City, where she lived with her devout Mormon family. Smart was raped by him nearly every day, sometimes several times a day. The only other person in their camp was Mitchell’s wife, Wanda Barzee, who treated Smart like her slave

She’s now married, finishing work on her degree at Brigham Young University and the head of the Elizabeth Smart Foundation.

When she was asked about the best advice her mother gave her, she said:

My mom said to me, “Elizabeth, what this man has done to you, it’s terrible, there aren’t words strong enough to describe how wicked and evil he is. He has stolen nine months of your life from you that you will never get back. But the best punishment you could ever give him is to be happy, is to move forward with your life and to do exactly what you want to do. … The best thing you can do is move forward because by feeling sorry for yourself and holding on to what’s happened, that’s only allowing him more power and more control over your life, and he doesn’t deserve another second. So be happy.” … I’m not perfect at following her advice … but I do try to follow it every day.

Be happy!