Skip to content

Instantly share code, notes, and snippets.

View mahdin75's full-sized avatar
🎯
Focusing

Mahdi Nazari Ashani mahdin75

🎯
Focusing
View GitHub Profile
@iamgeoknight
iamgeoknight / polygon_split.js
Last active February 28, 2024 13:16
Split Polygon by Line
onGeomChange = (e) => {
/*
This function will dynamically split the polygon into two parts by a line and will follow geometry change event.
*/
//Create jsts parser to read openlayers geometry
let parser = new jsts.io.OL3Parser();
//Creating line geometry from draw intraction
let linestring = new ol.Feature({
@shreyas90999
shreyas90999 / lgbm_hyperopt_optimization.py
Last active September 19, 2024 18:17
Lgbm optimization using hyperopt
from hyperopt import hp, fmin, tpe, Trials, STATUS_OK
lgb_reg_params = {
'learning_rate': hp.uniform('learning_rate',0.1,1),
'max_depth': hp.choice('max_depth', np.arange(2, 100, 1, dtype=int)),
'min_child_weight': hp.choice('min_child_weight', np.arange(1, 50, 1, dtype=int)),
'colsample_bytree': hp.uniform('colsample_bytree',0.4,1),
'subsample': hp.uniform('subsample', 0.6, 1),
'num_leaves': hp.choice('num_leaves', np.arange(1, 200, 1, dtype=int)),
'min_split_gain': hp.uniform('min_split_gain', 0, 1),
@rahul619anand
rahul619anand / RabbitMQvsKafka.txt
Last active August 22, 2024 18:56
Kafka vs RabbitMQ
RabbitMQ
* Written in Erlang
* Scaling strategies - is mostly vertical
* Supports topics and queues
* if you want to have high persistence guarantees, RabbitMQ ensures replication across the cluster and on disk on message send.
* Reliable message broker as we get acknowledgement (AMQP based)
* Use RabbitMQ if you have messages (20k+/sec) that need to be routed in complex ways to consumers, you want per-message delivery guarantees, you don’t care about ordered delivery, you need HA at the cluster-node level now, and/or you need 24×7 paid support in addition to forums/IRC.
* RabbitMQ is good for “slow” and unreliable consumers
@odan
odan / xampp_php7_xdebug.md
Last active October 19, 2024 04:15
Installing Xdebug for XAMPP