- All teams will henceforth expose their data and functionality through service interfaces.
- Teams must communicate with each other through these interfaces.
- There will be no other form of interprocess communication allowed: no direct linking, no direct reads of another team’s data store, no shared-memory model, no back-doors whatsoever. The only communication allowed is via service interface calls over the network.
- It doesn’t matter what technology they use. HTTP, Corba, Pubsub, custom protocols — doesn’t matter.
- All service interfaces, without exception, must be designed from the ground up to be externalizable. That is to say, the team must plan and design to be able to expose the interface to developers in the outside world. No exceptions.
- Anyone who doesn’t do this will be fired.
- Thank you; have a nice day!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yes | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type S struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
) | |
type X struct { | |
B []byte `json:"b"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285 | |
gcm() { | |
# Function to generate commit message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://jameshfisher.com/2018/02/20/c-inline-assembly-hello-world/ | |
int main(void) { | |
register int syscall_no asm("rax") = 1; | |
register int arg1 asm("rdi") = 1; | |
register char* arg2 asm("rsi") = "hello, world!\n"; | |
register int arg3 asm("rdx") = 14; | |
asm("syscall"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://go.dev/play/p/HTKZzENHPcG | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type Color struct{ c uint } |
Why browsers do not send If-None-Match for caching images? Why browser does not try to get 304 status code for caching?
This can be because there are video html that is trying to load at same time.
This can break some browser behavior that will not even attempt to use cached images for some reason.
Make preload="none"
for videos to stop loading them, and then browser will attempt to use etags for images.
Add Cache Control: public
. This will make Safari to attempt If-None-Match
and make 304 requetsts. private
should also work.
2024-04-23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://go.dev/play/p/1nLXyCDe1_3 | |
// because UNIX! 🐣 | |
package main | |
import "fmt" | |
var ( | |
Read = Permission{0x1} | |
Write = Permission{0x2} | |
Execute = Permission{0x4} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🍧 | |
package main | |
import "fmt" | |
type LRUCache struct { | |
size int | |
vals map[string]string | |
order PtrList | |
} |
Convert to CSV
jq -r '[.function_name, .call_count] | @csv'
NewerOlder