Skip to content

Instantly share code, notes, and snippets.

View kconde2's full-sized avatar

Kaba Condé kconde2

View GitHub Profile
@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)
@KVytyagov
KVytyagov / find_result_check_performance.php
Last active June 26, 2025 10:55
performance instanceof vs eq(null)
<?php
$iterations = 10**6;
class SomeVeryLongNameForCompareWithSomeVeryPerfectMethodOrStrategyAndSomeOtherWordsInThisName {}
class Short{}
function checkInstanceOfLongClassName($val): bool {
return $val instanceof SomeVeryLongNameForCompareWithSomeVeryPerfectMethodOrStrategyAndSomeOtherWordsInThisName;
}
@Baldinof
Baldinof / .dockerignore
Last active June 28, 2025 21:10
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
@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
@evansims
evansims / Dockerfile
Last active September 16, 2024 07:08
Dockerfile: php-fpm 7.4-fpm alpine w/ gd bz2 intl mbstring redis mongodb xdebug opcache
FROM php:7.4-fpm-alpine
WORKDIR "/application"
# Install essential build tools
RUN apk add --no-cache \
git \
yarn \
autoconf \
g++ \
make \
@ktsakalozos
ktsakalozos / refresh-certs.sh
Last active October 9, 2023 01:47
Refresh MicroK8s Certs
#!/bin/bash
set -eu
export SNAP_NAME="microk8s"
export SNAP_DATA="/var/snap/microk8s/current/"
export SNAP="/snap/microk8s/current/"
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
source $SNAP/actions/common/utils.sh
<?php
namespace App\Services\Dto;
abstract class AbstractDto
{
/**
* AbstractRequestDto constructor.
* @param array $data
*/
@kconde2
kconde2 / Function.Array-Group-By.php
Created May 3, 2020 18:39 — forked from mcaskill/Function.Array-Group-By.php
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@soyuka
soyuka / UserIdentitiferNormalizer.php
Last active August 10, 2023 21:49
Me route ApiPlatform
<?php
namespace App\Identifier;
use App\Entity\User;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
@benoitpetit
benoitpetit / docker-compose.yml
Last active September 22, 2025 17:13
complete Gitlab installation and a runner with docker
version: '4.5'
services:
# GITLAB
gitlab-web:
image: 'gitlab/gitlab-ce:latest'
restart: always
container_name: gitlab-web
hostname: '192.168.0.14'
environment: