Skip to content

Instantly share code, notes, and snippets.

View msztorc's full-sized avatar
🎧
WFH

Mirosław Sztorc msztorc

🎧
WFH
View GitHub Profile
@msztorc
msztorc / curl-github-api-render-markdown.md
Created November 30, 2023 09:40 — forked from jkullick/curl-github-api-render-markdown.md
Render Markdown with cURL & Github API
curl \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{"text": "$TEXT", "mode": "markdown"}' \
  https://api.github.com/markdown
@msztorc
msztorc / centos_php_fpm_coredumps.md
Created January 21, 2023 16:03 — forked from mkubenka/centos_php_fpm_coredumps.md
How to enable CentOS PHP-FPM coredumps.

CentOS PHP-FPM coredumps

https://wiki.archlinux.org/index.php/Core_dump

Enabling core dumps for PHP-FPM on CentOS 7 require several steps.

Set the rlimit_core directive in /etc/php-fpm.d/pool.conf and /etc/php-fpm.conf to unlimited:

rlimit_core = unlimited
@msztorc
msztorc / modal.html
Created May 19, 2022 21:12 — forked from dpawluk/modal.html
Establishing a modal instance and communicating with it from the parent instance
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous">
</script>
</head>
@msztorc
msztorc / Core dumps and gdb backtrace for apache.md
Last active May 24, 2022 11:20 — forked from arungpro/Core dumps and gdb backtrace for apache
Core dumps and gdb backtrace for php-fpm and apache

#PHP Apache CORE DUMP - GDB backtrace

Open httpd.conf: vi httpd.conf

Add following line main config section: CoreDumpDirectory /tmp/apache2-gdb-dump

Unlimited core dump size, In terminal add below ulimit -c unlimited

@msztorc
msztorc / git-pushing-multiple.rst
Created August 31, 2021 20:24 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

<?php
function ver_compare($v1, $v2) {
function fversion($v) {
$c = substr_count($v, '.');
switch($c) {
case 0: $v .= '.0.0'; break;
case 1: $v .= '.0'; break;
}
@msztorc
msztorc / imagemagick - optimize gif
Created May 20, 2020 08:32
imagemagick - optimize gif
convert input.gif -strip -fuzz 2% +dither -coalesce -layers Optimize output.gif
convert input.gif -strip -scale 914x284 -fuzz 2% +dither -coalesce -layers Optimize output.gif
@msztorc
msztorc / composer-local-package.md
Last active May 19, 2020 19:09
composer local package

composer.json

"repositories": [
    {
        "type": "path",
        "url": "/full/or/relative/path/to/development/package"
    }
]
First of all, google-chrome is requried to be installed in guest OS:
$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
$ sudo apt-get update && sudo apt-get install -y google-chrome-stable
Next thing is xvfb:
$ sudo apt-get install -y xvfb
Try to start ./vendor/laravel/dusk/bin/chromedriver-linux --port=8888. If you have some errors about loading libraries (libnss3.so, libgconf-2.so.4), try this:
<?php
phpinfo();