Skip to content

Instantly share code, notes, and snippets.

View vanleantking's full-sized avatar
🤣

Le Van vanleantking

🤣
  • U
  • Binh Thanh
View GitHub Profile
@vanleantking
vanleantking / mongodb analytics tools
Created April 1, 2023 07:07
mongodb analytics tools
But MongoDB is a general-purpose database, and not a data analysis tool, so a common pattern when analysing data that's stored within MongoDB is to extract the results of a query into a Numpy array, or Pandas dataframe, and to run complex and potentially long running analyses using the toolkit those frameworks provide. Until recently, the performance hit of converting large amounts of BSON data, as provided by MongoDB into these data structures, has been slower than we'd like.
Ref:
https://www.mongodb.com/developer/languages/python/pymongoarrow-and-data-analysis/
https://arrow.apache.org/use_cases/
@vanleantking
vanleantking / git branch command
Created August 31, 2020 14:21
git branch command
create new branch
-- git checkout -b [branch_name]
delete branch local
-- git branch -d [branch_name]
delete remote branch
-- git push origin --delete [branch_name]
merge branch master remote into feature branch
@vanleantking
vanleantking / câu query lấy tất cả các field của collection mongo
Created March 24, 2023 09:51
câu query lấy tất cả các field của collection mongo
db.getCollection("report_detail").aggregate([
{'$match':{'date':'2023-03-01'}},
{ "$project": {
"hashmaps": { "$objectToArray": "$$ROOT" }
} },
{ "$group": {
"_id": null,
"fields": { "$addToSet": "$hashmaps.k" }
} },
{ "$project": {
@vanleantking
vanleantking / worker pool
Created March 3, 2023 18:14
worker pool
https://medium.com/@B1scuit/creating-a-worker-pool-in-go-21e62907f732
@vanleantking
vanleantking / phpstorm_evaluation_license_reset.md
Created February 20, 2023 14:49 — forked from Gyvastis/phpstorm_evaluation_license_reset.md
PhpStorm reset evaluation license/period

PhpStorm reset evaluation license/period

Make sure to export/import your settings through File -> Manage IDE settings before/after

Windows 10

  1. Close PHPStorm
  2. Run these in PowerShell to remove PhpStorm configuration:
Remove-Item '.\AppData\Local\Jetbrains\PhpStorm*'
Remove-Item '.\AppData\Roaming\Jetbrains\PhpStorm*'
@vanleantking
vanleantking / pymysql auto reconnect
Created January 28, 2023 09:28
pymysql auto reconnect
https://stackoverflow.com/questions/22699807/python-mysql-using-pymysql-auto-reconnect
@vanleantking
vanleantking / message broker vs message queues
Created January 25, 2023 09:51
message broker vs message queues
1. message queue
queue = data structure == first in first out = the first message added to queue, is the first item to leave the queue.
=> a message queue contains messages with data about events that follow the FIFO order.
2. message broker:
is a software, enables aplication, systems and services can communication each others
@vanleantking
vanleantking / convert string into numeric python use pandas
Created January 5, 2023 18:03
convert string into numeric python use pandas
https://stackoverflow.com/questions/53622737/pandas-convert-strings-to-numeric-if-possible-else-keep-string-values?fbclid=IwAR3qEt7TOTIuOiB3URDPHWFQE41tClh_nFT8OgwCDKsb_8UAZKr8X-bMglw
https://towardsdatascience.com/converting-data-to-a-numeric-type-in-pandas-db9415caab0b
https://stackoverflow.com/questions/69659219/convert-a-data-frame-in-which-one-column-contains-array-of-numbers-as-string-to
https://stackoverflow.com/questions/379906/how-do-i-parse-a-string-to-a-float-or-int
https://stackoverflow.com/questions/5316720/how-to-convert-string-values-from-a-dictionary-into-int-float-datatypes
https://stackoverflow.com/questions/354038/how-do-i-check-if-a-string-represents-a-number-float-or-int
@vanleantking
vanleantking / reset php storm 2021 window 10
Created January 3, 2023 02:03
reset php storm 2021 window 10
C:\Users\Admin\AppData\Roaming\JetBrains\PhpStorm2020.2
Delete "eval" folder
Delete "options/other.xml"
Go to your registry editors' path: Computer\HKEY_CURRENT_USER\SOFTWARE\JavaSoft\Prefs\jetbrains\phpstorm
Remove all inner folders.
Relaunch PHPStorm
@vanleantking
vanleantking / docker run single service in docker compose file
Created December 15, 2022 03:53
docker run single service in docker compose file
docker-compose up -d --no-deps --build app