Skip to content

Instantly share code, notes, and snippets.

View PandaHugMonster's full-sized avatar
🇺🇦
StandWithUkraine

Ivan Ponomarev PandaHugMonster

🇺🇦
StandWithUkraine
  • Celantur GmbH
  • Vienna, Austria
View GitHub Profile
@PandaHugMonster
PandaHugMonster / shell-whatsup.sh
Last active October 14, 2025 10:33
Quick notifier about command result.
# Add this snippet into your `.bashrc` to get access to `boop`, `nah` and `whatsup
# To check commands:
# `whatsup "Success Test" "sleep 2 && echo 'Panda said Hello'"`
# `whatsup "Failure Test" "sleep 2 && echo 'Panda silently left into the void' && my-non-existing-command"`
alias boop='notify-send -u critical -i /usr/share/icons/Humanity/status/128/info.svg --hint=STRING:sound-file:/usr/share/sounds/sound-icons/cembalo-1.wav '
alias nah='notify-send -u critical -i /usr/share/icons/Humanity/status/128/important.svg --hint=STRING:sound-file:/usr/share/sounds/sound-icons/cembalo-6.wav '
function fmt_seconds () {
@PandaHugMonster
PandaHugMonster / display-image-from-yii2.php
Created October 24, 2024 04:28
Yii2 return Image Content as blob and display it by the browser properly
function actionDisplay() {
$response = Yii::$app->response;
$response->format = Response::FORMAT_RAW;
$response->headers->add("Content-Type", "image/png");
$response->headers->add("Content-Disposition", "inline; filename=test.png");
$response->data = $content;
return $response;
}
@PandaHugMonster
PandaHugMonster / install-php-diff-versions.sh
Last active March 23, 2024 15:04
Installation of Ondrej's different PHP versions at once (Mint, Ubuntu)
#!/bin/bash
apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt install php8.0 php8.1 php8.2 php8.3
apt install php8.{0,1,2,3}-{dom,curl,mbstring,bcmath,gmp,xdebug}
@PandaHugMonster
PandaHugMonster / shell-path-init.sh
Last active December 14, 2017 21:34
Simple YII2 shell-path-init
#!/bin/sh
##
## Ivan Ponomarev <ivan.ponomarev.pi@gmail.com>
##
## This script is needed only for simple setting of some important variables
## To use it inside of the BASH: `source enter.sh` or `. enter.sh`
## Is required to be inside of the directory of the application.
##
## To apply use in bash:
@PandaHugMonster
PandaHugMonster / hibernate.cfg.xml
Created November 21, 2015 02:00
Hibernate main config XML file
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/database</property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
@PandaHugMonster
PandaHugMonster / httpd-phpmyadmin.conf
Created November 20, 2015 02:30
Arch Virtual Host for phpMyAdmin
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
AllowOverride All
Options +Indexes +FollowSymLinks +ExecCGI
Allow from all
Require all granted
php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"
</Directory>