Skip to content

Instantly share code, notes, and snippets.

npx swagger-typescript-api --no-client -p http://localhost:5183/swagger/v1/swagger.json -n model.ts
@whynotavailable
whynotavailable / index.js
Last active November 1, 2021 03:57
example.js
class Example {
flip(text) {
return [...text].reduce((previousValue, currentValue) => currentValue + previousValue, '');
}
run(text) {
return this.flip(padLeft(text))
function padLeft() {
return '000' + text;

How not to fuck up OAuth2

I've seen a number of articles posted here recently that just give terrible advice when it comes to OAuth2, so I figured I'd make this so people would dick themselves over.

The reason people do this, is because they are just writing filler nonsense content in the hopes you'll click on the website. They don't care if the content is solid because they just want you to see the ads.

As for my credentials, I work for a major fintech company with part of my duties being to help developers get set up with OAuth2 in their applications.

If you aren't a lazy fuck, just read this, and the next section on decoupling. Otherwise I've summarised the important bits later on.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

AFI List [18/100]

  • [X] Citizen Kane
  • [ ] The Godfather
  • [ ] Casablanca
  • [ ] Raging Bull
  • [X] Singin’ in the Rain
  • [ ] Gone with the Wind (film)
  • [ ] Lawrence of Arabia (film)
  • [ ] Schindler’s List
  • [ ] Vertigo
@whynotavailable
whynotavailable / .editorconfig
Last active March 12, 2020 01:04
my editor config
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 3
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 3
@whynotavailable
whynotavailable / main.go
Last active March 9, 2020 22:31
middleware example in go
package main
import (
"errors"
"log"
"net/http"
)
type handler func(writer http.ResponseWriter, request *http.Request, context map[string]string) error