TitleDoesNotMatter

Django dump all data into JSON

I know you could do it by dumping the database directly, but this could come in handy when you’re trying to migrate from one database to another. AFAIK, copying data from one kind of DB to another kind(think Pgsql to MySql) is a nightmare… Luckily, Django provides a utility to make this super easy.

Read More

Angular FormBuilder group unexpectedly change array to value

Problem Component editor receives an object and create reactive form base on the object passed in. Something like this(most fields are omitted): this.form = new FormBuilder().group({ id: this.postObj.id, tags: this.postObj.tags, }); But you will realise the tags field does not really behave like what you wanted(well, at least not what I was expecting) Pass in: […]

Read More

Jenkins Docker in Docker

Yesterday I was trying to deploy a Jenkins on a Linux machine. From my past experience, the official Jenkins Docker image works very well, I can build all of my projects without doing any messy configuration. However, the latest Jenkins Docker image seems to be a simplified version, as in most of the plugins and […]

Read More

CircleCI and Coveralls integration

Spent 2 hours to figure out how to automate Coveralls checking in CircleCI, the online articles are really outdated and not working… Solution You will need this library github.com/mattn/goveralls The idea is to run test coverage and save it into a file, then use the above lib to post it to Coveralls. Don’t forget to […]

Read More

ngx-admin infinite interceptor call

Problem After setting up Auth in ngx-admin, the http call gets stuck in interceptor. You may see error in console like Max call stack reached… Pattern First step to solve a problem is finding when or what the problem is triggered. The problem seems to happen daily and the workaround is to clear the token […]

Read More

Symbolic link fails on MacOS

Problem when you try to symbolic something using ln -s xx xx, you may get Operation not permitted error. Even sudo can’t solve the problem. Solution You need to enable full disk access to your terminal. Go Setting -> Security & Privacy -> Full Disk Access and add your terminal app in the list. (I’m […]

Read More

FreeRTOS xSemaphoreTake always fail

Here I am using binary a semaphore to protect(lock) a shared resource. Only one of Task 1 and Task 2 can only get the lock at any given time. Problem xSemaphoreTake() always return pdFALSE which means the semaphore is not available. I’ve checked all my code, no one take the semaphore… This really drives me […]

Read More
Copy link
Powered by Social Snap