Skip to content

Instantly share code, notes, and snippets.

View szemate's full-sized avatar

Máté Szendrő szemate

  • London / Budapest
View GitHub Profile
@szemate
szemate / order.ts
Created June 26, 2024 11:13
AirSwap Last Look order
import {
ChainIds,
createOrderERC20,
createOrderERC20Signature,
OrderERC20
} from '@airswap/utils';
import { Server } from '@airswap/libraries';
const signer = process.env.PRIVATE_KEY;
const signerWallet = '0x455777268Bd43C983ba82D9DE4efa0445af99D96';
@szemate
szemate / regexp_hu.md
Last active November 16, 2022 08:24
Reguláris kifejezések

Reguláris kifejezések

Speciális karakterek

  • .: bármilyen karakter
  • \s: üres hely karakter (space, tab, új sor)
  • \d: számjegy
  • \w: alfanumerikus karakter (angol ABC kis- és nagybetűi, számjegyek és _)
  • \p{L}: mint a \w, de Unicode (ékezetes) karakter is lehet
  • \S: bármilyen karakter, ami nem üres hely
@szemate
szemate / pizzaGenerator.ts
Last active October 16, 2022 17:28
Pizza Generator exercise solution
// https://gist.github.com/szemate/537792a6cf39008d51192fc8a3034d9a
const toppings = [
'ham',
'salami',
'mushroom',
'spinach',
'artichoke',
];
@szemate
szemate / arrayAlgos.js
Last active October 13, 2022 19:25
The most common elementary algorithms in JavaScript
// The most common elementary algorithms in JavaScript
'use strict';
const testNumbers = [8, 6, 3, 7, 3, 8, 4, 4, 9, 1, 2, 8];
// 1. Search
function contains(array, elemToFind) {
for (let i = 0; i < array.length; i++) {
if (array[i] === elemToFind) {
@szemate
szemate / html-converter.md
Last active September 15, 2022 12:34
HTML converter exercise

HTML to Plain Text Converter

Create a script that takes the name of a HTML file as a command line argument, and prints its visible content as plain text to standard output (to the terminal).

  • Only the body contents should be printed.
  • All HTML tags and indentation should be removed.
  • Contents of block elements (<p>, <h#>, <div>) should be divided by empty lines.
  • Line breaks (<br />) should be respeced.
  • Only <br /> elements should be treated as line breaks, new line characters should not.
@szemate
szemate / pizza-generator.md
Last active October 15, 2022 05:23
Pizza Generator

Pizza Generator

A pizza place offers the following toppings:

  • ham
  • salami
  • mushroom
  • spinach
  • artichoke
@szemate
szemate / package-lock-conflicts.md
Last active August 29, 2024 10:39
How to resolve package-lock.json conflicts

How to resolve package-lock.json conflicts

It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

  1. Update the master branch with the latest changes:
    git checkout master
    git pull
    
  2. Merge your feature branch into master:
@szemate
szemate / word-score.md
Last active March 17, 2022 17:56
Scrabble Word Scores Exercise

Scrabble Word Scores Exercise

In this word game points are awarded based on the length of the word and the letters used. The user has to create a word from the letters in their hand. Their hand consists of 7 letters.

Could you create a function which returns the correct scores for the words played? The input is a list of words, and the output is an object where the keys are the words played and the values are the word points.

@szemate
szemate / feature-branch-exercise.md
Last active February 19, 2022 14:29
Git feature branch exercise

Feature branching exercise

The trainee who shares the screen

  1. Fork https://github.com/szemate/git-branching-demo
  2. Add the other trainees in the breakout room as collaborators (to the forked repository)

Everyone in the breakout room

  1. Confirm yourself as a collaborator
@szemate
szemate / api-exercise.md
Last active October 30, 2021 07:40
API exercise

API Exercise

We will discover the Chuck Norris Jokes API. The documentation can be found at https://api.chucknorris.io/.

  1. Read the "Usage" section and try each endpoint in the browser.
  2. Retrieve a random Chuck Norris fact related to movies. You will need to combine the data from two endpoints.