Cross Code
43 subscribers
233 photos
28 videos
1 file
125 links
Everyone has a channel now why not me ig.
Expect dev and gaming stuff.
In-joy

Discussions here - https://t.me/+CkXl8tSd-Ds0YmVk
Download Telegram
Forwarded from The Beno Logs
Forwarded from Troll Football
Arsenal haters right now

@Troll_Football_Telegram
Forwarded from /g/‘s Tech Memes (damir :з)
new captcha malware! dont fall for it (src)
Lets go
HTMX suing itself lmao
Ethiopian govt be like:
>We wreck ur home.
You: 😭
>We give you land and money to build new home
You:😕 ok ig better than nothing
>*gives you land and money if ur lucky *
You: Ok ok not bad ig 😐
You: * try to build a new home with the money and land they gave you *
> No No No u gotta wait for 2 years to start construction
You: FFuck YOu You MOthEr FuCKing FUck 🤬
Forwarded from Beka (Beka)
https://docs.astro.build/en/guides/authentication/#better-auth

Better Auth is now on Astro official authentication guide 🥳
Please open Telegram to view this post
VIEW IN TELEGRAM
😁1
Madrid on that crossbar challenge 😂😂😂
🎯 Nominal vs Structural Types 🎯

Nominal Types (like in Java/C#):
Types are compared by name. Even if two types look the same, they’re not compatible unless you say so (explicitly cast it).
class Cat { public int Legs; }
class Dog { public int Legs; }

Cat myCat = new Cat();
Dog myDog = new Dog();
// Error: Cannot assign Cat to Dog, even though both have Legs.


Structural Types (like in TypeScript/Go):
Types are compared by structure. If two types have the same shape, they’re compatible—even if they have different names.

type Cat = { legs: number };
type Dog = { legs: number };

let myCat: Cat = { legs: 4 };
let myDog: Dog = myCat; // No problem! They have the same structure.

💡 TL;DR:

Nominal: Focuses on the name of the type.
Structural: Focuses on the shape of the type.
Still rocking Edge and using bing as my main search engine.
First one to answer will get unlimited nightly package:
defining a type that describes any allowable JSON value.
here is the starting code:
// @errors: 2578
type JSONObject = any
type JSONArray = any
type JSONValue = any

////// DO NOT EDIT ANY CODE BELOW THIS LINE //////
function isJSON(arg: JSONValue) {}

// POSITIVE test cases (must pass)
isJSON("hello")
isJSON([4, 8, 15, 16, 23, 42])
isJSON({ greeting: "hello" })
isJSON(false)
isJSON(true)
isJSON(null)
isJSON({ a: { b: [2, 3, "foo"] } })

// NEGATIVE test cases (must fail)
// @ts-expect-error
isJSON(() => "")
// @ts-expect-error
isJSON(class {})
// @ts-expect-error
isJSON(undefined)
// @ts-expect-error
isJSON(BigInt(143))
// @ts-expect-error
isJSON(isJSON)