Skip to content

Instantly share code, notes, and snippets.

View smolijar's full-sized avatar
🐈‍⬛
I can has cheezburger?

Jaroslav Šmolík smolijar

🐈‍⬛
I can has cheezburger?
View GitHub Profile
@smolijar
smolijar / LICENSE
Last active August 6, 2020 04:51
protocat logo
MIT License
Copyright (c) 2020 Jaroslav Šmolík
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@smolijar
smolijar / kitty.conf
Last active November 24, 2023 14:09
kitty.conf
font_family Cascadia Code
bold_font Cascadia Code Bold
italic_font Cascadia Code Italic
bold_italic_font Cascadia Code Bold Italic
font_size 14.0
disable_ligatures never
background #222222
foreground #c4c4b5
const numbers = [ 1, 2, 3 ]
const isOdd = num => {
console.log(['isOdd', num])
return num % 2 === 0
}
const double = num => {
console.log(['double', num])
return num * 2
}
This file has been truncated, but you can view the full file.
error: Extra semicolon (semi) at ../liam-api/src/app/components/authyWrapper.ts:1:32:
> 1 | import logger from 'app/logger';
| ^
2 | import * as authy from 'authy';
3 | import config from 'config/config';
4 |
error: Extra semicolon (semi) at ../liam-api/src/app/components/authyWrapper.ts:2:31:
1 | import logger from 'app/logger';
{
"editor.fontFamily": "'Firicico', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.fontSize": 15.5,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
//following will be in italics (=Pacifico)
// "comment",

Hlavni temata

  • Typescript - Jazyk ve kterem to popisuju (ma "TS" logo)
  • Kompozice funkci - To co popisuju. Je to prosty skladani funcki, ma zname notace g(f()) resp g ∘ f 
  • Rekurze - (~sebereference) Prostredek, kterym to popisuju

Vedlejsi temata

Hodne znamy knihovny, ktery to nejak popisujou a beru je jako referenci:

Typescript: Function composition and recurrent types

While I was working on our toolkit library Desmond I stumbled upon a problem when defining the TypeScript definition for a function pipe.

With help from Joe Calzaretta, a software developer working for MIT's IS&T, I defined type definitions for a variadic function composition in TypeScript, that is in some aspects superior to the existing solutions implemented in popular libraries.

Adapting the proposed solution I managed to define the HOC function type for composition without overloads, ultimately allowing it to safely type-check function chain for any number of arguments, which is a feature lacking in type definitions of even extremely popular utility libraries such as Lodash.

What is pipe?

@smolijar
smolijar / omit_type.md
Last active November 28, 2018 09:20
omit_type
author tags
Jaroslav Šmolík
typescript
omit
meta type
generic type

Omit type and meta programming

Post entity

@smolijar
smolijar / tz_dates_mysql.md
Last active November 20, 2018 16:31
[TZ dates in MySQL]

Timezoned dates in MySQL 🐬

Problem 😿

Error: ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: '2017-10-10T06:50:04.006Z' for column 'created_at' at row 1

Solution 😺

MySQL config, e.g.: /etc/mysql/my.cnf

@smolijar
smolijar / isa_model_in_ts.md
Last active November 28, 2018 07:40
Isa model in Typescript

ISA model in TypeScript

😿 Lousy solution

export enum ServiceType {
    ServiceOperation = 'serviceOperation',
    BikeRent = 'bikeRent',
    OrderCharge = 'orderCharge',
}

export interface ServiceAttributes {