Skip to content

Instantly share code, notes, and snippets.

View eduardstula's full-sized avatar
🌴
On vacation

Eduard Štůla eduardstula

🌴
On vacation
View GitHub Profile
#!/bin/bash
set -e
echo "▶️ Odhlašuji Tailscale a zastavuji službu..."
tailscale logout || true
systemctl stop tailscaled || true
systemctl disable tailscaled || true
echo "🧹 Odinstalovávám balíčky Tailscale..."
for repo in $(curl "https://[gitlab]/api/v4/groups/2?private_token=[token]" | jq .projects[].ssh_url_to_repo | tr -d '"'); do git clone $repo; done;
#!/bin/bash
for gitdir in `find ./ -name .git -not -path "*/vendor/*"`;
do
workdir=${gitdir%/*};
echo;
echo $workdir;
git --git-dir=$gitdir --work-tree=$workdir status;
done
#!/bin/bash
for gitdir in `find ./ -name .git -not -path "*/vendor/*"`;
do
workdir=${gitdir%/*};
echo;
echo $workdir;
git --git-dir=$gitdir --work-tree=$workdir pull;
done
find ../../projects/ -maxdepth 2 -name "composer.json" -exec grep -l nette/application {} \;
@eduardstula
eduardstula / xdebug-php.ini
Last active August 14, 2020 14:29
PHP/Xdebug/PhpStorm
# Widnows
# zend_extension = C:\xampp74\php\ext\php_xdebug.dll
# MacOs
# zend_extension = xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 0
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
@eduardstula
eduardstula / lazyloading.js
Created July 31, 2020 15:01
vanilla-lazyload with webp-hero polyfill
import LazyLoad from 'vanilla-lazyload';
//https://gist.github.com/eduardstula/417b6b5f6b304edec1b4945ab5ebb62e
import webpPolyfill from './webp';
new LazyLoad({
elements_selector: '.lazy',
callback_error: () => {
webpPolyfill();
}
});
@eduardstula
eduardstula / webp.js
Created July 31, 2020 14:48
webp-hero polyfill suport forms inputs in Safari
import {defaultDetectWebpImage, detectWebpSupport, WebpMachine} from 'webp-hero';
import {Webp} from 'webp-hero/libwebp/dist/webp.js';
//https://github.com/chase-moskal/webp-hero/issues/18#issuecomment-560188272
class FixedWebpMachine extends WebpMachine {
constructor() {
const opts = {
webp: new Webp(),
webpSupport: detectWebpSupport(),
@eduardstula
eduardstula / GitHub-Forking.md
Created January 7, 2020 19:40 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

#!/bin/bash
cd /var/lib/openhab2/backups/
sudo openhab-cli backup
git add .
git commit -m "backup"
git push origin master