Skip to content

Instantly share code, notes, and snippets.

View sdolidze's full-sized avatar

Sandro Dolidze sdolidze

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YoungMinds - Digital Wellness for Young People</title>
<style>
* {
margin: 0;
padding: 0;
use std::fmt;
pub enum List {
Cons(i32, Box<List>),
Nil,
}
impl fmt::Display for List {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
const obj = {};
obj["Alpha"] = "Alpha";
obj["1"] = 1;
obj["0.5"] = 0.5;
obj["0"] = 0;
obj["Beta"] = "Beta";
console.log(Object.keys(obj));
function Decorator(label: string) {
return (...args: unknown[]) => {
console.log(label);
}
}
@Decorator('a')
@Decorator('b')
class Person {
@Decorator('c')
const name = Symbol("name");
const age = Symbol("age");
const obj = {
[name]: "John",
[age]: 29,
};
console.log(obj[name]);
console.log(obj[age]);
for (var i = 0; i < 3; i++) {
setTimeout(() => {
console.log(i);
});
}
const Hello = () => {
console.log("a");
useEffect(() => {
console.log("b");
});
useLayoutEffect(() => {
console.log("c");
});
class RedLogger {
constructor(prefix) {
this.prefix = prefix;
}
log(text) {
console.log(this.prefix, text);
}
}
export interface Page {
id: string;
name: string;
url: string;
title: string;
description: string | null;
priority: number;
frequency: string;
}
function remove(id: string, items: NavLink[]): NavLink[] {
return items
.filter(x => x.id !== id)
.map(item => ({
...item,
children: remove(id, item.children),
}));
}