Skip to content

Instantly share code, notes, and snippets.

View mhsenpc's full-sized avatar

Mohsen Shamohammadi mhsenpc

View GitHub Profile
@mhsenpc
mhsenpc / LanguageGameCommand.php
Last active August 24, 2023 14:22
A game for practising words with their meaning. it is implemented as a laravel command. you just need to choose the right answer through the 3 items
<?php
class LanguageGameCommand extends BaseCommand {
/**
* The console command name.
*
* @var string
*/
protected $name = 'game:play';
@mhsenpc
mhsenpc / calc_ration.sql
Created September 30, 2020 09:17
Calculate Image ratio function for MySql and MariaDB
DELIMITER $$
DROP FUNCTION IF EXISTS calc_ratio;
CREATE FUNCTION calc_ratio(width int,
height int)
RETURNS VARCHAR(10)
DETERMINISTIC
BEGIN
DECLARE ratio VARCHAR(10);