Skip to content

Instantly share code, notes, and snippets.

View AdamFiser's full-sized avatar

Adam Fišer AdamFiser

View GitHub Profile
@AdamFiser
AdamFiser / GIT-Cheatsheet-pull_rebase
Created May 14, 2025 19:31
Git Cheat Sheet: `git pull origin main --rebase`
# 🧩 Git Cheat Sheet: `git pull origin main --rebase`
## 🔍 Co dělá příkaz
```bash
git pull origin main --rebase
```
Stáhne změny z větve `main` ve vzdáleném repozitáři `origin` a **přehraje vaše lokální commity** na konec těchto změn (namísto klasického merge).
---
@AdamFiser
AdamFiser / GIT-cheatsheet-vetve.md
Created May 14, 2025 19:28
Git Cheatsheet – Práce s větvemi (Branches)

Git Cheatsheet – Práce s větvemi (Branches)

📉 Co je to větev?

Větev (branch) je samostatná vývojová linie. Pomáhá oddělit práci na nové funkci nebo opravě, aniž byste zasahovali do hlavní verze kódu.


📌 Základní příkazy

| Akce | Příkaz | Popis |

@AdamFiser
AdamFiser / mysql_root_password_reset.md
Last active November 21, 2023 10:16
MySQL reset zapomenutého hesla uživatele root

Otevřít soubor C:\xampp\mysql\bin\my.ini

Najít sekci [mysqld] a hned pod něj přidejte skip-grant-tables. Například:

# The MySQL server
[mysqld]
skip-grant-tables
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
@AdamFiser
AdamFiser / combining-git-repositories.md
Created October 20, 2021 06:21 — forked from msrose/combining-git-repositories.md
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@AdamFiser
AdamFiser / \extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php
Created August 4, 2021 07:03
Mediawiki - Oprava SyntaxHighlight na Windows \extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php - Řádek 334 a dále, nahradit zakomtovaný text novým "hackem"
/* wanex hack
$result = Shell::command(
self::getPygmentizePath(),
'-l', $lexer,
'-f', 'html',
'-O', implode( ',', $optionPairs )
)
->input( $code )
->restrict( Shell::RESTRICT_DEFAULT | Shell::NO_NETWORK )
->execute();