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 / 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
@vanleantking
vanleantking / MongoDB aggregation allowUseDisk
Created December 10, 2022 08:49
MongoDB aggregation allowUseDisk
MongoDB aggregation stage limits
Aggregation works in memory. Each stage can use up to 100 MB of RAM. You will get an error from the database if you exceed this limit.
If it becomes an unavoidable problem you can opt to page to disk, with the only disadvantage that you will wait a little longer because it is slower to work on the disk rather than in memory. To choose the page to disk method, you just need to set the option allowDiskUse to true like this:
db.collectionName.aggregate(pipeline, { allowDiskUse : true })
Note that this option is not always available shared services. For example Atlas M0, M2 and M5 clusters disable this option.
https://studio3t.com/knowledge-base/articles/mongodb-aggregation-framework/
https://stackoverflow.com/questions/54283513/how-to-get-all-user-details-user-name-at-least-who-had-logged-in-windows-compu
https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic
@vanleantking
vanleantking / workers use buffer channel
Created November 10, 2022 10:16
workers use buffer channel
https://play.golang.com/p/9uHR2jIDR9y
package main
import (
"fmt"
"time"
)