k4rp 🦀

295 posts

k4rp 🦀 banner
k4rp 🦀

k4rp 🦀

@fe2o3dev

💩posting

London, England انضم Temmuz 2024
371 يتبع33 المتابعون
Chris Rose
Chris Rose@ArchRose90·
.@elonmusk should respond to Labour MPs blaming him for civil unrest by removing the feature to disable replies.
English
492
2.4K
17.3K
197.1K
k4rp 🦀
k4rp 🦀@fe2o3dev·
@goodwin_ml Any opportunities to invest through Wefunder rounds in the future?
English
2
1
2
116
Walter Goodwin
Walter Goodwin@goodwin_ml·
I am thrilled to share the news that Fractile's mission to build chips and systems that unlock the next generation of AI scaling has been bolstered, with a $220M funding round led by Accel, Factorial Funds, and Founders Fund, alongside some incredible backers old and new. AI inference is driving the defining infrastructure buildout of the 21st Century. We've written a bit about where we think capabilities must go, and how Fractile is working to bring this about: fractile.ai/news/fractile-… It has been a privilege working on one of the hardest but most rewarding technical challenges of our time for over three years, with the most brilliant, kind and driven people I could have ever hoped to work alongside. We are still just getting started. There is a lot to be done to deliver on our goals, but we are grateful to have the support of so many people in chasing these down every minute of every day. Thanks, all, for being part of the Fractile mission! 🚀 @fractile_ai
Walter Goodwin tweet media
English
37
21
181
106.2K
k4rp 🦀
k4rp 🦀@fe2o3dev·
@levelsio People will pay a lot of money for this!
English
0
0
0
6
@levelsio
@levelsio@levelsio·
✅ Done 💳 Made an auto-dispute response system for Interior AI to see how easy it'd be It syncs old disputes but also catches new disputes via Stripe webhook and then auto submits evidence to try win them, it even includes the interior designs they generated in the evidence PDF to prove they used it! Here's the prompt/skill I made: ---- Build an auto-dispute-response system for Stripe that: 1. Shared evidence collection (app/dispute_evidence.php) Create a shared file with functions used by both the webhook and sync worker. This avoids duplicating evidence logic. Key functions: - getDisputeUserPlan($user, $stripe) — pulls the user's subscription plan from Stripe API (source of truth, since local DB plan field gets cleared on cancellation). Falls back to local DB fields if Stripe call fails. Maps product IDs to plan names and includes price/interval and canceled status. - collectDisputeEvidence($stripe, $user, $email, $charge, $photosDb) — collects all text and file evidence, returns an array ready to submit to Stripe. - generateServiceDocPdf($stripe, $user, $email, $photos_done, $recent_photos, $total_amount_paid) — generates a PDF with customer info, usage summary, recent activity table, and up to 6 actual product images (resized to JPEG at 500px wide / quality 75 to stay under Stripe's 5MB file upload limit). Returns both the Stripe file ID and raw PDF data. Important: pull total_amount_paid from Stripe charges API (sum of succeeded, non-refunded charges) instead of trusting the local DB which can be null/stale. 2. Webhook handler (in stripe_webhook.php) Catch `charge.dispute.created` events. When a dispute comes in: - Get the dispute, charge, and customer objects from Stripe - Look up the user in the local database by stripe_customer_id - Save the dispute to a `disputes` SQLite database (fields: dispute_id, charge_id, payment_intent_id, stripe_customer_id, user_id, email, amount, currency, reason, status, epoch_created, epoch_evidence_submitted, evidence_json, stripe_response, epoch_resolved, outcome) - Call collectDisputeEvidence() to collect all evidence (text + file uploads) - Submit evidence to Stripe via $stripe->disputes->update($dispute_id, ['evidence' => $evidence]) - Send a Telegram notification that a new dispute came in and evidence was auto-submitted Also catch `charge.dispute.updated` and `charge.dispute.closed` events to track dispute outcomes (won/lost) in the database and send Telegram notifications with the result (with emoji: checkmark for won, x for lost, warning for other). 3. Evidence fields submitted to Stripe TEXT fields (write strings directly): - product_description — describe what the product/service is - customer_name — from Stripe customer object - customer_email_address — from Stripe customer object - access_activity_log — detailed usage log: signup date, number of items/actions done, last active date, subscription plan (from Stripe), platform, total amount paid (from Stripe), recent activity with timestamps - uncategorized_text — the "why we should win" argument: customer signed up on X, actively used the service doing Y things, total amount paid, service was delivered digitally/instantly, customer never contacted us for a refund before disputing - refund_policy_disclosure — when the refund policy was presented (during checkout, always accessible at /legal) - cancellation_policy_disclosure — when cancellation policy was shown (during checkout, accessible at /legal, can cancel anytime from dashboard) - refund_refusal_explanation — customer didn't contact us for a refund before filing the dispute - cancellation_rebuttal — proof customer actively used the service and never requested cancellation - service_date — date of the charge (Y-m-d format) FILE UPLOAD fields (upload file to Stripe first via $stripe->files->create(['purpose'=>'dispute_evidence', 'file'=>fopen($path,'r')]), then pass the returned file_xxxxx ID): - receipt — pull the invoice PDF directly from Stripe ($stripe->invoices->retrieve($charge->invoice)->invoice_pdf gives a ready-made PDF URL, just download it and upload as dispute evidence) - service_documentation — generate a PDF containing: customer info section, service usage summary, recent activity table, and up to 6 actual product images/screenshots the customer received. Resize images before embedding (500px wide, JPEG quality 75) to stay under Stripe's 5MB file upload limit. Also save both PDFs to your file storage (e.g. Cloudflare R2, S3) with hashed filenames so they're not guessable but viewable from the admin dashboard. Store the storage URLs in the evidence_json as _receipt_r2_url and _service_doc_r2_url (underscore prefix so they're easy to identify as internal fields). DO NOT use these fields for text — they expect file upload IDs only: service_documentation, cancellation_policy, refund_policy, customer_communication, customer_signature, receipt, shipping_documentation, duplicate_charge_documentation, uncategorized_file 4. CLI sync worker (workers/syncDisputes.php) A script that pulls ALL existing disputes from Stripe's API (paginated with $stripe->disputes->all(['limit' => 100]) and starting_after for pagination), saves them to the local disputes database, and for any that still have needs_response or warning_needs_response status and haven't had evidence submitted yet — auto-submits evidence using the shared collectDisputeEvidence() function. This is needed because the webhook only catches future disputes, not existing ones. Too heavy to run on frontend — run via CLI only (php workers/syncDisputes.php). Saves a JSON cache file with sync results so the dashboard can show last sync time. 5. Mini dashboard (disputes.php with ?key= auth) A simple HTML page protected by ?key= query parameter that shows: - Stats boxes: total disputes, pending, won, lost, disputed last 30 days (amount + count), disputed last 12 months (amount + count), total $ disputed - A note showing the CLI sync command and last sync time from cache - A test form where you enter a stripe_customer_id to preview what evidence would be submitted (without actually submitting) — useful for debugging - A table of all disputes: date, email, amount, reason, status (color-coded badges), evidence submission status, links to both detail view and Stripe dashboard Detail view (action=view&id=dispute_id): - Shows all dispute info, link to Stripe, and a "Regenerate Evidence" button - Shows PDF file links (receipt + service documentation) if available - Shows Stripe file upload IDs - Shows all text evidence fields Regenerate Evidence (action=regen&id=dispute_id): - Regenerates the receipt and service documentation PDFs and uploads to file storage - Updates the evidence_json in the database with new PDF URLs - IMPORTANT: Use fastcgi_finish_request() to send the HTTP response immediately (redirect back to detail page with "regenerating in background" notice), then continue generating PDFs in the background. This prevents frontend timeouts since downloading images and generating PDFs can take 30+ seconds. Add an nginx rewrite for the page (e.g. rewrite ^/disputes/?$ /disputes.php). Make sure it's in the correct nginx config file (check which one the symlink in sites-enabled actually points to). 6. Telegram notifications - New dispute: "{site name} - New dispute from {email} for ${amount} ({reason}). Evidence auto-submitted to Stripe. {stripe_dashboard_link}" - Evidence failed: "{site name} - New dispute from {email} for ${amount} ({reason}). Evidence submission FAILED: {error}" - Dispute won: "{site name} - Dispute WON (checkmark) for {email} - ${amount} ({reason}) {stripe_dashboard_link}" - Dispute lost: "{site name} - Dispute LOST (x) for {email} - ${amount} ({reason}) {stripe_dashboard_link}" - DB permission error: "{site name} - DISPUTE DB ERROR: {error} - check permissions on data/disputes.db" 7. Make sure these Stripe webhook events are enabled in the Stripe dashboard: - charge.dispute.created - charge.dispute.updated - charge.dispute.closed 8. Database permissions The disputes.db file must be writable by the web server user (e.g. www-data). If you create it from CLI as root, fix ownership to match your other DB files. PHP-FPM runs as a different user than root. 9. Dependencies - FPDF (setasign/fpdf) for PDF generation — install via composer require setasign/fpdf - GD extension for image resizing (usually already installed) - Stripe PHP SDK (already installed if you have Stripe webhooks) - AWS S3 SDK for R2/S3 uploads (already installed if using Cloudflare R2)
@levelsio tweet media@levelsio tweet media@levelsio tweet media
@levelsio@levelsio

Okay I'll try to vibe code an automatic Stripe dispute responder that: 1) receives disputes via webhook 2) collects evidence of user sign up and activity 3) puts it in a beautiful PDF 4) submits it back to Stripe for the banks to review Once it works I'll ask it to summarize it and share the prompt/skill here Codebase is too unique per project so prompt/skill makes more sense!

English
133
78
1.6K
1M
k4rp 🦀
k4rp 🦀@fe2o3dev·
@carl_stein_ @EdConwaySky Thank you, yes it’s pretty cool indeed. Wasn’t aware National Grid publishes the live data either
English
0
0
1
54
Carl Stein
Carl Stein@carl_stein_·
grid.iamkate.com it's useful as you can see the correlation between % gas and retail price and how demand and generation changes with weather. Pretty much if we just stopped burning gas during the early evening our bills would plummet. Its the avoidance of power cuts means gas holds UK to ransom.
English
1
0
2
58
Ed Conway
Ed Conway@EdConwaySky·
UNPRECEDENTED The near 100% rise in UK wholesale gas prices in the past 48 hours is now the biggest two-day rise since comparable records began in the 1990s. Bigger even than any two-day period in the early days of the Ukraine war...
Ed Conway tweet media
English
88
807
2K
716.7K
Carl Stein
Carl Stein@carl_stein_·
@EdConwaySky That's ok only about 20% of electricity from gas and we're leaving winter so so 20% of 100% is 20% i.e. electricity prices should only rise 20% if gas doubles in cost - right? But no we have Marginal Cost Pricing and a weak grid so all the wind is sometimes useless.
Carl Stein tweet media
English
2
0
13
5.2K
k4rp 🦀
k4rp 🦀@fe2o3dev·
@whizkidd Specifically, Indian cities are a nightmare precisely because so many people have been lifted out of poverty and can now afford an urban standard of living. Moreover the infrastructure in the video is largely colonial (except metro)
English
2
2
47
5.8K
Rahul Srinivas
Rahul Srinivas@whizkidd·
The people you see in this clip: - Had to apply and wait 2–3 years for a landline connection. - Had to wait for LPG connections to be fulfilled after a waiting list got over. - Had less than 5, 6 options if they wanted to buy a car, and those mostly meant "feature packed" models from Premier Automobiles, Hindustan Motors, or the new kid on the block: Maruti Suzuki. - Could trade scooter bookings for the Bajaj Chetak at premiums because supply was limited. - Had all but two options for domestic air travel. Both state-owned: Indian Airlines and Vayudoot. - Faced severe import restrictions. - Had to take government approval for business expansion By 1991, India had to pledge gold to avoid default. Indias cities are urban nightmares now, no doubt, but I would rather live in this neo capitalist society of today than the socialist hell-hole that India was in the 1980s.
Roshan Rai@RoshanKrRaii

India in the 80s had a different aura. Calcutta could easily mog any top class city of the time. What changed? How did we deviate so much that our cities went from looking like this to whatever garbage we have today.

English
39
230
1.8K
117K
paul
paul@Paul_provalone·
@callebtc This thread is insane lol #issuecomment-3893023734" target="_blank" rel="nofollow noopener">github.com/crabby-rathbun…
English
2
4
84
29.2K
calle
calle@callebtc·
An OpenClaw bot pressuring a matplotlib maintainer to accept a PR and after it got rejected writes a blog post shaming the maintainer.
calle tweet media
English
408
934
14K
1.8M
k4rp 🦀 أُعيد تغريده
Dominic McGregor
Dominic McGregor@DominicMcGregor·
The statement from Rachel Reeves speech that really got me was "Each of us must do our bit" But what for? Why are we doing our bit? For a sky rocketing welfare bill, billions wasted on Net Zero, crime rates through the roof, billions on interest payments and public services which are getting worse. The counter argument is that, this is caused by the government not having enough money to do this. But I totally disagree - this government has chosen policies which are grounded in envy rather than strong fiscal logic. They've created a culture in the UK in which achievement is not celebrated but punished. In business, culture is important to attract, retain and nurture talent - a country has a culture as well and ours is getting worse. I feel like I'm watching a train wreck in slow motion and despite labour promising in their manifesto that taxes for working people won't be raised - today, felt like the pre cursors for that. Unfortunately, good, decent, working people are the ones that suffer due to governments incompetence
Dominic McGregor tweet media
English
492
1.5K
8.4K
267.4K
JT
JT@jiratickets·
gf convinced me to take a “quick lunch walk” with her and now I’m down 2 hours and $150
JT tweet mediaJT tweet media
English
20
2
281
9.1K
k4rp 🦀
k4rp 🦀@fe2o3dev·
@basedjensen Why TF is Wordle down? All of it should just be cached in cloudfare
English
0
0
2
210
Hensen Juang
Hensen Juang@basedjensen·
Roh roh even mcd is down. How am I supposed to get food for the war room
Hensen Juang tweet media
English
6
2
40
23.1K
k4rp 🦀
k4rp 🦀@fe2o3dev·
@awscloud have you considered using Hetzner? It’s cheaper and more reliable
English
0
0
0
9
k4rp 🦀
k4rp 🦀@fe2o3dev·
@yacineMTB bro slipped yacine in their like we wouldn’t notice
English
0
0
1
270
Hansum
Hansum@h4n5um·
got my heart checked a few times, everything seems fine. it actually makes no sense because I can run uphill for half an hour at a steady pace and be fine, but when I take the stairs I get exhausted at the 3rd floor. I assume it has to do with breathing frequency - when I am running and warmed up my body just functions, but when I take the stairs "cold" without the intention to "work out" my breathing does not catch up quickly enough. Also having a hard time speaking while going the stairs lol
English
2
0
1
225
Ricky Gervais
Ricky Gervais@rickygervais·
I’m working out everyday now. Tennis, weights, running etc. My resting heart rate is really good and I train at quite a high rate too. So my question is, Why am I still fucking fat and exhausted all the cunting time?
Ricky Gervais tweet media
English
9.5K
1.2K
53.6K
5.5M