Skip to content

Instantly share code, notes, and snippets.

@kconde2
kconde2 / image_phpstorm_server.png
Created February 11, 2020 14:58 — forked from esilvajr/image_phpstorm_server.png
How to use XDebug inside a docker container.
image_phpstorm_server.png
@Baldinof
Baldinof / .dockerignore
Last active February 13, 2024 22:52
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
@KVytyagov
KVytyagov / find_result_check_performance.php
Last active September 3, 2024 11:47
performance instanceof vs eq(null)
<?php
$iterations = 10**6;
class SomeVeryLongNameForCompareWithSomeVeryPerfectMethodOrStrategyAndSomeOtherWordsInThisName {}
class Short{}
function checkInstanceOfLongClassName($val): bool {
return $val instanceof SomeVeryLongNameForCompareWithSomeVeryPerfectMethodOrStrategyAndSomeOtherWordsInThisName;
}
@dl6nm
dl6nm / Grafana-TelegramBot-HowTo.md
Last active December 13, 2023 16:21 — forked from subzeta/gist:26cd1a1f1526411862b3a3a0b4422d3d
How to create a Grafana bot for Telegram

Set up a Telegram Bot

  1. Go to Grafana > Alerting > Notification channels > New channel.
  2. Type: Telegram. It will ask you for a Bot API Token and a Chat ID.
  3. Open a chat with BotFather on Telegram.
  4. Type /newbot
  5. Type your bots name. e.g. Grafana Bot
  6. Type your bots username. e.g. a_new_grafana_bot
  7. You get your Bot API Token. Paste it on Grafana.
  8. Before making getUpdates (in the next step) you should add your bot into your telegram client and run /start. Thus you start chatting with the bot and this room is assigned chat id. (Thanks to @KES777)
@imShara
imShara / eslint-nuxt-fix-on-save.md
Created August 24, 2019 10:36
ESlint automatically fix on file save with Nuxt

Old Way

Suggested by lcaprini

// nuxt.config.js
build: {
  extend(config, ctx) {
    if (ctx.dev && ctx.isClient) {
      config.module.rules.push({
 enforce : 'pre',
@zoilomora
zoilomora / README.md
Last active April 20, 2025 20:46
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active May 20, 2025 03:39
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@emmanuelnk
emmanuelnk / script.bash
Last active July 1, 2022 11:29
Installing vscode transparency/blur ubuntu 18.04
# [UPDATE]
# Its no longer complicated! Yay!
# Install Glassit Linux VSCode Extension
# then install this:
sudo apt install -y wmctrl x11-utils bash
# then restart VSCode. Done!
@florentchauveau
florentchauveau / .gitlab-ci.yml
Last active May 9, 2025 12:27
GitLab CI yaml file for building docker images
# This is a GitLab CI configuration to build the project as a docker image
# The file is generic enough to be dropped in a project containing a working Dockerfile
# Author: Florent CHAUVEAU <[email protected]>
# Mentioned here: https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/
# do not use "latest" here, if you want this to work in the future
image: docker:20
stages:
- build
@axelvnk
axelvnk / OrSearchFilter.php
Last active November 1, 2024 23:08
Api platform OR search filter
<?php
namespace Axelvkn\AppBundle\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\ORM\QueryBuilder;
class OrSearchFilter extends SearchFilter