Skip to content

Instantly share code, notes, and snippets.

View bkrmendy's full-sized avatar
💭
⚡️

Bertalan Körmendy bkrmendy

💭
⚡️
  • Budapest, HU
View GitHub Profile
@bkrmendy
bkrmendy / vector.h
Last active March 16, 2023 13:50
vector
#include <stdexcept>
#include <iostream>
#include <initializer_list>
template <typename T>
class Vector
{
static constexpr std::size_t min_capacity = 8;
public:
@bkrmendy
bkrmendy / eyedropper.d.ts
Last active May 14, 2023 11:28
eyedropper.d.ts
interface ColorSelectionOptions {
signal?: AbortSignal
}
interface ColorSelectionResult {
sRGBHex: string
}
interface EyeDropper {
open: (options?: ColorSelectionOptions) => Promise<ColorSelectionResult>
def plotDist(topplesize, xmin, xmax):
fit = powerlaw.Fit(
data = np.array(topplesize),
xmin = xmin,
xmax = xmax
)
x, y = fit.pdf(linear_bins=True)
ind = y>0
y = y[ind]
x = x[:-1]
package com.berci;
import java.util.ArrayList;
import java.util.Arrays;
record Tuple<T, U>(T one, U other){}
@FunctionalInterface
interface Combine<T> {
T method(T left, T right);
interface Balanced {
boolean check(String input);
}
interface Checkout {
int total(Cart c, List<Discount> dc);
}
@bkrmendy
bkrmendy / effects.ts
Created September 18, 2021 18:43
Typescript effects via generators
function maybe<T>(gen: () => Generator<T, any, any>): T | null {
const next = gen();
let last = undefined;
while (true) {
const { value, done } = next.next(last);
if (done) {
return value;
}
if (value == null) {
return null;
import inspect
def with_checks(checks):
def wrapper(func):
def wrapped(*args, **kwargs):
bound_args = inspect.signature(func).bind(*args, **kwargs)
errors = list()
for check in checks:
decorator_params = inspect.signature(check).parameters.keys()
matching_params = [(sym, bound_args.arguments[sym]) for sym in decorator_params if sym in bound_args.arguments.keys()]
if len(matching_params) > 0:

react.js Best Practices

Our Best Practices for Writing React Components

import { string, object } from 'prop-types'

this.setState(prevState => ({ expanded: !prevState.expanded }))

state = { count: this.props.initialCount };

Grafika

Geometriai alapfogalmak

Mondj egy-egy axiómát az euklideszi, hiperbolikus és projektív geometriából, amely a többi geometriának nem érvényes állítása.

  • Euklidészi: egy egyeneshez csak 1 nem metsző egyenes húzható
  • Gömbi: két egyenes mindig két pontban metszi egymást
  • Gömbi: egy egyeneshez több rajta kívül fekvő egyenes is húzható
  • Projektív: két egyenes pontosan 1 pontban metszi egymást

SDS JAVASCRIPT WORKSHOP témák

JAVASCRIPT

  • ES6
  • code quality
  • functional programming

REACT

  • basic html/css
  • react basics