Use pdb module in debugging python: 1$ python3 -m pdb pdb_example.py and something like this: 1student@ubuntu:~$ python3 -m pdb pdb_example.py 2> /home/student/pdb_example.py(1)<module>() 3-> class Student: 4(Pdb) continue 50 61 72 83 94 10The program finished and will be restarted 11> …
Read MoreIf you ever need to serve your current directory via http for some reason, here's an NPM module solution 1~$ yarn global add serve And run this (it's automatically added to ~/.bashrc or equivalent on your shell): 1export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" and run 1~$ serve …
Read MoreJSON or JavaScript Object Notation is a data representation standard shown in a key:value pair, just like a traditional JavaScript object. Here's the key info you need to know about it: All the data in the file must be surrounded by curly braces if you're representing it as an object, and in square brackets if it is …
Read MoreExcerpt from https://stackoverflow.com/questions/52737078/how-can-you-use-axios-interceptors 1To talk in simple terms, it is more of a checkpoint for every HTTP action. Every API call that has been made, is passed through this interceptor. 23So, why two interceptors? 45An API call is made up of two halves, a request, …
Read MoreFrom Command Line: Do it something like this: 1~$ npm view react version And you get the version directly: 1~$ npm view react version 218.0.0 Other means, see https://stackoverflow.com/questions/36994564/how-can-one-tell-the-version-of-react-running-at-runtime-in-the-browser
Read MoreSingle Email With Multiple Recipients 1$emailRecipient = ['email01@example.com', 'email02@example.com']; 2Mail::to($emailRecipient)->send(new MailOnServiceFailure($logTimestamp, $failedContent)); 3Log::info("Service Failure Mail Alert sent successfully to " . json_encode($emailRecipient)); …
Read MoreRebase is used in merging two or more commits into one. Per experience, you can only rebase to an older commit. Say, in these commits 1~$ git log -2 --pretty=oneline 2a0dd6b55000399c5f8b5f0f55286e167725e51c2 (HEAD -> v0.2.x_wip, origin/v0.2.x_wip) docktie_cli getx: Tested working implementation for #17. …
Read MoreSometimes, for automation purposes, you would like to get the latest commit in a working copy. Below is how you do it. 1~$ git rev-parse --short HEAD Remove the --short HEAD if you need the longer version.
Read MoreDoing a backup of your mysql container's DB can be automated just like any other task. Script below is one way to do it. You may or may not provide a parameter to the script and you'll always get the gzipped version of the backup + its sha256 checksum. Sample Use Case: use it without parameters 1~$ ./backup_db.sh …
Read MoreYes, csv is simple BUT if you want it readable in Excel (at least on Windows), you need to prepend it with a hidden BOM and as UTF8. Tried every possible suggestions in stackoverflow that says it works BUT it doesn't. So, try the phpoffice approach. It works for me... Install 1~$ cd /an/isolated/directory 2~$ composer …
Read More