Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯

Chandan Bhattad meetchandan

🎯
View GitHub Profile
View noon.json
{
"breadcrumbs": [],
"navPills": [{
"name": "Household Supplies",
"code": "home-and-kitchen/household-supplies",
"filter": "category"
}, {
"name": "Kitchen & Dining",
"code": "home-and-kitchen/kitchen-and-dining",
"filter": "category"
View food-cms.json
{
"nbPages": 1,
"nbHits": 14,
"canonical_url": "/search?type=outlet",
"navPills": [{
"name": "Great Offers",
"code": "*",
"filter": "has_discount",
"isSelected": false
}, {
View instant-catalog.json
{
"nbHits": 1,
"nbPages": 1,
"search": {
"q": "chocolate",
"sort": null,
"f": {},
"page": 1,
"rows": 20
},
View instant-data-model.py
# all tables would have created_at and updated_at
#servicability
class InstantWarehouse(Model):
__tablename__ = 'instant_warehouse'
id_instant_warehouse = sa.Column(INT, primary_key=True)
warehouse_code = sa.Column(sa.String(20), unique=True, index=True)
country_code = sa.Column(sa.String(20), nullable=False)
area_name = sa.Column(sa.String(50), nullable=False)
@meetchandan
meetchandan / latency.txt
Created Aug 6, 2021 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
View nat_sdk.js
axios = require("axios");
const envHostMap = {
"prod": "https://etracker.noon.com/track/",
"stg": "https://etracker.noonstg.com/track/",
"dev": "https://etracker.noondv.com/track/",
}
let natSdk = { initialized: false, params: {} };
View wf.py
payloads = DefaultDataConverter().to_payloads(["param1", "param2", "param3"])
request = StartWorkflowExecutionRequest(namespace=namespace, workflow_id=workflow_id,
request_id="restart",
workflow_type=WorkflowType("GoWorkflow"),
task_queue=TaskQueue("go_task_queue"),
input=payloads,
workflow_task_timeout=timedelta(minutes=5),
workflow_execution_timeout=timedelta(days=365 * 2))
await ctx.wf_service.start_workflow_execution(request=request)
View withdrawable_balance.py
# Goal: Only COD returns should be withdrawable to bank
# Rest everything should be refund to source -- or remain in wallet
# withdrawable balance table structure:
# customer_code
# country_code
# amount
# On every return request picked_up/verified
@meetchandan
meetchandan / latency.markdown
Created Feb 28, 2021 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
View scraper.txt
scrape_target
-----------
id_scrape_target
mp_code
country_code
catalog_sku
frequency_minutes
is_active
created_at