Skip to content

Instantly share code, notes, and snippets.

@frencojobs
frencojobs / vercel-deployment-types.md
Last active July 15, 2023 09:40
Vercel Deployment Types

I'm gonna assume the response from /v13/deployments/:id is the ideal response and compare it to the deployment interfaces responded from other endpoints.

Deployment from v6/deployments

  1. id is uid
  2. aliasAssignedAt is aliasAssigned, note that aliasAssigned is a boolean field in the ideal response
  3. createdAt is duplicated into created, there're two fields with the same value in there, created and createdAt
  4. the creator field returns two more properties, email and githubLogin
  5. readyState is renamed as state, the ideal response here is duplicating it though, the v13/deployments/:id respond with both status and readyState, they are the same
  6. it's missing a lot of fields, including the ones on aliases
@frencojobs
frencojobs / diff.json
Created June 28, 2023 08:28
Differences between upstream Codicons & VSCode's Codicons
{
"removed": [
"codicon-bell-slash",
"codicon-bell-slash-dot",
"codicon-blank",
"codicon-circle",
"codicon-circle-large",
"codicon-circle-small",
"codicon-circle-small-filled",
"codicon-comment-draft",
@frencojobs
frencojobs / dropper.ts
Created March 13, 2023 05:07
Dropper Pattern in NestJS
import {Module, Inject, Injectable, ConfigurableModuleBuilder} from '@nestjs/common'
const {ConfigurableModuleClass, MODULE_OPTIONS_TOKEN} = new ConfigurableModuleBuilder<unknown>().build()
@Injectable()
class DropperService<T> {
constructor(@Inject(MODULE_OPTIONS_TOKEN) private readonly value: T) {}
drop(): T {
return this.value
@frencojobs
frencojobs / fallbacks.css
Last active January 22, 2023 06:20
Fallbacks for my favourite fonts
@font-face {
font-family: 'Inter Fallback';
src: local('Arial');
ascent-override: 90%;
descent-override: 22.43%;
line-gap-override: 0%;
size-adjust: 107.64%;
}
@font-face {
@frencojobs
frencojobs / readline.dart
Created March 9, 2021 12:24
Dart read from console line by line asynchronously.
import 'dart:async';
import 'dart:convert';
import 'dart:io' as io;
/// Reads a single line from [stdin] asynchronously.
Future<String> readLine() async {
final c = Completer<String>(); // completer
final l = io.stdin // stdin
.transform(utf8.decoder) // decode
.transform(const LineSplitter()) // split line
@frencojobs
frencojobs / and_then_vs_map.rs
Last active December 11, 2020 06:44
I made Intuitive Rust Examples that made me understand the concepts of Option
// difference between and_then vs map for `Option`
fn increment(n: i32) -> Option<i32> {
Some(n).map(|x| x + 1)
}
fn main() {
let one = Some(1);
let four = one
.map(|one| one + 1)
@frencojobs
frencojobs / typescriptreact.json
Last active November 10, 2020 05:14
My vscode snippets.
{
"react functional component": {
"prefix": "rfc",
"body": [
"export const ${TM_FILENAME_BASE/(\\w)/${1:/upcase}/}: React.FC = () => {",
" return <>$0</>",
"}"
],
"description": "react functional component"
},
@frencojobs
frencojobs / yield.dart
Created September 4, 2020 09:56
Me trying my best to explain yield* syntax of dart.
Iterable<int> inner() sync* {
for (final i in [4, 5, 6]) {
yield i;
}
}
Iterable<int> outer() sync* {
for (final i in [1, 2, 3]) {
yield i;
}
@frencojobs
frencojobs / action_button.dart
Created June 18, 2020 01:18
How I make better-looking IconButton replacement.
import 'package:flutter/material.dart';
class ActionButton extends StatelessWidget {
final Function onPressed;
final Icon icon;
ActionButton({
@required this.onPressed,
@required this.icon,
});