Skip to content

Instantly share code, notes, and snippets.

View petrofcikmatus's full-sized avatar

Matus Petrofcik petrofcikmatus

View GitHub Profile
@petrofcikmatus
petrofcikmatus / git-reset-author.sh
Created February 3, 2022 11:43 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@petrofcikmatus
petrofcikmatus / xdebug-mac.md
Created November 7, 2018 12:27 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2018

🪲 Install and Configure xDebug on Mac for PhpStorm 🐘

⚠️ This guide only applies to Homebrew v1.6+

  • Check your version brew --version before proceeding

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache
@petrofcikmatus
petrofcikmatus / git_rebase.md
Created October 26, 2018 10:40 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@petrofcikmatus
petrofcikmatus / sublime-command-line.md
Created October 25, 2018 21:13 — forked from adrianorsouza/sublime-command-line.md
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@petrofcikmatus
petrofcikmatus / README.md
Last active May 22, 2018 21:35
What I do every time I install Ubuntu

Installing Ubuntu

Generate SSH key

ssh-keygen -t rsa -b 4096 -C "matus@petrofcik.eu"

Add SSH key to SSH Agent

@petrofcikmatus
petrofcikmatus / Dockerfile
Last active June 16, 2023 08:08
Automated nginx proxy for Docker containers
FROM php:7.1-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends git zlib1g-dev libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl gettext zip pdo pdo_mysql \
&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/web!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/web \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

PHPStorm Cheatsheet

Keyboard shortcuts

Storm

  • cmd + shift + a - find action
  • shift + ESC - close window

Find