Skip to content

Instantly share code, notes, and snippets.

View Luke-SNAW's full-sized avatar

Luke SNAW Luke-SNAW

View GitHub Profile
@Luke-SNAW
Luke-SNAW / python-releated__tools.md
Last active February 6, 2022 23:53
[Tools releated python] #tools
@Luke-SNAW
Luke-SNAW / article.md
Created December 14, 2021 23:32
[Give me /events, not webhooks](https://blog.syncinc.so/events-not-webhooks) #API

bkrausz

I was responsible for Stripe's API abstractions, including webhooks and /events, for a number of years. Some interesting tidbits:

Many large customers eventually had some issue with webhooks that required intervention. Stripe retries webhooks that fail for up to 3 days: I remember $large_customer coming back from a 3 day weekend and discovering that they had pushed bad code and failed to process some webhooks. We'd often get requests to retry all failed webhooks in a time period. The best customers would have infrastructure to do this themselves off of /v1/events, though this was unfortunately rare.

The biggest challenges with webhooks:

  • Delivery: some customer timing out connections for 30s causing the queues to get backed up (Stripe was much smaller back then).

https://news.ycombinator.com/item?id=29478375

Business logic happens line by line between interfaces. Coding may be all ifs and for loops, but when it comes to implementing a new feature, having chosen carefully where to draw the line between, say, your model and your view can be the difference between a 10 line patch and a complete rewrite.

If you don’t have a culture of code review then maybe the rewrite will fly, bugs and all, through to production. If however you have the ability to reason logically about the salient changes diff by prescient diff — where by definition each prescient diff represents nothing but the salient changes — then you at least stand a fighting chance of version N+1 having fewer bugs than version N while also moving your business forwards.

--

  • You Can't Buy Understanding of Your Problems
  • You Can't Buy Someone Else Caring about Your Problems
@Luke-SNAW
Luke-SNAW / css.md
Created December 7, 2021 23:22
[uBlock, I exfiltrate: exploiting ad blockers with CSS] https://portswigger.net/research/ublock-i-exfiltrate-exploiting-ad-blockers-with-css #css #security
<link href="steal-lowercase.css" rel="stylesheet" />
<link href="styles.css" rel="stylesheet" />
<input />
//steal-lowercase.css:
@font-face {
  src: url("/a");
 unicode-range: U+0061;	// a
@Luke-SNAW
Luke-SNAW / build.js
Last active December 6, 2021 04:00
[Webpack setting for build log] #webpack
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
@Luke-SNAW
Luke-SNAW / back-end__collections.md
Created December 6, 2021 00:22
[Back-end collections] #back-end #collections
@Luke-SNAW
Luke-SNAW / github-account.md
Created December 1, 2021 01:54
[Should I use my personal GitHub account for work?] https://webapps.stackexchange.com/a/76632 #github
@Luke-SNAW
Luke-SNAW / cli-collections.md
Last active November 29, 2021 00:06
[cli collections] #collections #cli
@Luke-SNAW
Luke-SNAW / infra-articles.md
Created November 22, 2021 00:56
[Infrastructure] #articles #infra