Skip to content

Instantly share code, notes, and snippets.

View s1rat-dev's full-sized avatar
🏹

Sırat Semih Çöp s1rat-dev

🏹
View GitHub Profile
interface Validator {
fun validate(request: Request)
}
0 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 |xxxxxxxxxxx
2 |xxxxxxxx
3 |xxxxxx
4 |xxxx
5 |xxx
6 |xxx
7 |xx
8 |xxx
9 |xx
0 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3 |xxxxxxxxxxxxxxxxxxxx
4 |xxxxxxxxxxxxxx
5 |xxxxxxxxxxx
6 |xxxxxxxxxx
7 |xxxxxxxxx
8 |xxxxxxxxx
9 |xxxxxxxx
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
0 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4 |xxxxxxxxxxxxxxxxxxxxxxxxx
5 |xxxxxxxxxxxxxxxxxxxxx
6 |xxxxxxxxxxxxxxxxxx
7 |xxxxxxxxxxxxxxxxxx
8 |xxxxxxxxxxxxxxxxxx
9 |xxxxxxxxxxxxxxxxxx
0 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3 |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4 |xxxxxxxxxxxxxxxxxxxxxxxxx
5 |xxxxxxxxxxxxxxxxxxxxxxxx
6 |xxxxxxxxxxxxxxxxxxx
7 |xxxxxxxxxxxxxxxxxxx
8 |xxxxxxxxxxxxxxxxxx
9 |xxxxxxxxxxxxxxxxxxxx
@s1rat-dev
s1rat-dev / classes.ts
Created March 2, 2022 18:29
[TYPESCRIPT] Annotations for classes.
class Vehicle {
public drive(): void {
console.log('chugga chugga');
}
public honk(): void {
console.log('beep');
}
}
@s1rat-dev
s1rat-dev / tuples.ts
Created February 20, 2022 00:56
[TYPESCRIPT] Annotations for tuples.
const drink = {
color: 'brown',
carbonated: true;
sugar: 40
}
// Creating tuple type.
// Used when we want to know what are any value of array.
// Easy way to sorting as value.
type Drink = [string, boolean, number];
@s1rat-dev
s1rat-dev / arrays.ts
Created February 20, 2022 00:14
[TYPESCRIPT] Annotations for arrays.
const carMakers = ['ford','toyota','honda'];
const dates = [new Date(), new Date()];
const carsByMake: string[][] = [];
// Help with inference when extracting values
const car = carMakers[0];
const myCare = carMakers.pop();
@s1rat-dev
s1rat-dev / objects.ts
Created February 19, 2022 14:17
[TYPESCRIPT] Annotations for objects.
const profile = {
name: 'Sırat',
age: 22,
coords: {
lat: 0,
lng: 15
},
setAge(age: number): void {
this.age = age;
}