2019-07-29
Version manage all the things

Recently I’ve re-installed Nodejs, python, and Ruby on my work machine.
When installing Ruby via Homebrew I was having trouble using it after
installation, then my collegue figured out that brew info ruby outputs
this message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/2.6.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
For compilers to find ruby you may need to set:
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"

At this point I think it’s probably just better avoid installing Ruby via
homebrew. I searched a bit and decided to go with version managers like nvm.

This article is a quick note on what I ended up using for each language
and how did I installed them.

Read More

2019-01-20
Install Ubuntu instance in WSL

There is already one when you enable WSL, but I’d like to install it on
different drives, and not need to worry about messing it up, so I discovered
a WSL Management tool LxRunOffline

Read More

2019-01-20
Issue with pacman

Been struggling to get my Arch Linux instance to do the upgrade for the past
two days.

First off, one of the PGP Key on my local is expired, so every pacman command
will return

1
error: pkgbuilder: signature from "Chris Warrick <kwpolska@gmail.com>" is unknown trust

and I cannot update archlinux-keyring to get the latest, renewed key because
I don’t have a valid key, it’s a infinite loop.

Later on I figured out that I need to temporarily disable pkgbuilder upgrades,
described in here.

Read More

2018-06-24
Setup Arch Linux in WSL

Recently I have tried to install Arch Linux under WSL (Windows Subsystem for Linux). So far I have positive experience and I actually prefer WSL over VirtualBox as my working environment under Windows 10.

Of course WSL is not perfect, compare to installing Arch under VirtualBox:

  • Pros
    • Faster startup time (just as fast as open a cmd window)
    • Share files bet
    • Running GUI apps via XServer is much more responsive, I think this is mostly because we don’t need to run GUI via SSH with this setup.
  • Cons
    • No “save machine state” functionality from VirtualBox
    • No audio support
    • There will always be a chance of running into compatibility issues, especially GUI apps.
    • You cannot edit any file under WSL data folder from Windows side, the file may become corrupted in WSL.
    • WSL won’t see any new file created (except share folders under /mnt/), so if you want to copy some files into WSL, you have to copy it in WSL shell via /mnt/ folder

I prefer WSL mainly because of better GUI experience, as I use VS Code for development most of the time.

Read More

2018-06-18
Package Managers for Windows and Mac

Cheetsheet

Usage Choco Brew
Upgrade manager choco upgrade chocolatey brew update
List installed packages choco list –local-only brew list
Search package choco search pkg –by-id-only brew search pkg1
Install package choco install pkg1 pkg2 brew install pkg1 pkg2
Check outdated packages choco outdated brew outdated
Update all packages choco upgrade all brew upgrade
Update specific packages choco upgrade pkg1 pkg2 brew upgrade pkg1 pkg2
Read More

2018-01-03
Semantic UI

Semantic UI is a component-based webpage layout Framework. I have used it on some of my personal projects and I really like it. Here are some of the benefits:

  • Components driven. You only pick up components you need
  • Ability to mix different themes in one project
  • Provide site level overrides so you don’t need to touch theme files themselves
  • Built-in Form validation
  • Components have initialize and destroy methods so they can be integrated as ReactJs and Vue.js components
Read More

2017-12-29
Pacman package manager cheatsheet

Pacman notes

Cheatsheet

Usage Command
Package upgrade pacman -Syu
Sync package DB pacman -Sy
Search package pacman -Ss package_name
Install package pacman -S package_name
Remove package and unused dependencies pacman -Rs package_name
List installed packages pacman -Qeq
Search installed package pacman -Qs package_name
  • Always do pacman -Syu before you install packages
Read More

2017-12-28
Install Archlinux & Xfce4 on VirtualBox

Below are random notes I jotted down when I installed Archlinux and Xfce4 on VirtualBox. It has been a while so there might be errors here and there.

Guest System configuration

  • EFI enabled
  • GPT partition table for all disks
  • GRUB bootloader
  • Network setting: NAT
Read More

2017-11-14
Back

My life had been busy from Aug 2016 to Aug 2017.

Read More

2016-10-03
Thoughts on today's javascript world

Two years after becoming a Front-End developer, and spending some of my free times learning node.js and some javasciript packages, all I can say to javascript is:

There are too many f**king thing you need to learn

Yeah, HTML/CSS/javascript is just the very basic, but those could already be the pain for some people. Nowadays nobody works on pure javascript, at least we need jQuery. But jQuery is not good when your code base starts to grow. So there is endless frameworks for webpage, such as Ember.js, AngularJS, Vue.js, React….so many different things you can choose/learn.

Node.js and npm is another beast. Node.js gives developers to run javascript in machines directly without browser, and with full system access like python and C++. Hence, a lot of packages for developing Front-End javascript are developed in Node.js and distributed via npm.
I would suggest new comers to learn these things in the following order:

1. HTML/CSS

The most basic stuff for web pages.

2. Browser javascript

This is the basic for the rest of the javascript world.

3. jQuery

Pure javascript can be tricky sometimes, and browser compatibility is a nightmare. jQuery solves most. It has been around since 2006 so there are tones of jQUery plugins out there. Hence today it is still difficult to not use jQuery completely.
You should keep the use of jQuery in the minimal way. DOM manipulation is very convenient in jQuery, but it is very easy to be abused and create codes that is very difficult to trace and mantain, so use it wisely.
Personally, for new projects I try to use jQuery only for AJAX calls, and maybe some jQuery plugins that I cannot find any good alternative.

4. lodash

lodash is a collection of utilities like sorting, map array to another array based on a function (map), or transform a list of objects to a object map (keyBy). Another similar package is underscore.js I found these packages are extremely helpful in my project, so I would definitely recommend you to learn them. Note that you only need one of them in your project.

5. Node.js and npm

Node.js is basically javascript for Back-End, but it is not just designed for web development, you can create regular programs too. npm is the package manager for Node.js. Even if you only want to be a Front-End developer, you should at least learn how to run node.js codes and how to use npm, so that you can install dependencies for your Front-End project.

But I would really recommend learn to code Node.js programs. It’s still javascript, and this is the shortcut for you to jump into Back-End development. Or even better, there is Electron, where you can write desktop applications in javascript. There is NativeScript, where you can write native Android/iOS apps in javascript.

6. Whatever you need for your project

At this point you should have the ability to learn most of the packages/frameworks in javascript world.
Keep in mind that since there are so many packages/frameworks out there today, it is impossible to learn them all. So when you see a new framework, only focus on “What” it does, “What” are the features, “What” are the problems it trying to solve. If you think your project can benefit from that package, only then you start to learn “How” to use it. This approach will save your time and prevent you from being overwhelmed by endless new stuffs.

I have been trying to figure out what is my favorite programming language since I graduated from college. I would say for now I love javascript the most The reason? Because you can just learn one language to develop everything for nearly every modern platform.

Read More