Skip to content

Instantly share code, notes, and snippets.

@developerck
developerck / jira standard workflow
Created August 8, 2025 06:54
jira standard workflow xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
<meta name="jira.description">Jira Standard Product workflow</meta>
<meta name="jira.update.author.id">5a6893f55552234543235831</meta>
<meta name="jira.update.author.key">5a6893f55552234543235831</meta>
<meta name="jira.updated.date">1710749387249</meta>
<initial-actions>
<action id="1" name="Create">
<validators>
@developerck
developerck / cte_mysql_moodle_subcategories.md
Created April 2, 2025 11:52
CTE MYSQL and GET MOODLE Sub categories with path
WITH RECURSIVE category_hierarchy AS (
    SELECT 
        id,
        NAME,
        parent,
        0 AS level,
        NAME AS path
    FROM 
 mdl_course_categories
@developerck
developerck / git patch.md
Created December 28, 2024 05:04
Gradetransferrer attribute addition in Moodle 4.4

grade/report/singleview/classes/local/screen/grade.php

@@ -265,7 +265,10 @@ class grade extends tablelike implements selectable_items, filterable_items {
             }
             if (array_key_exists($key, $lineclasses)) {
                 $cell->attributes['class'] = $lineclasses[$key];
           }
+            if($lineclasses[$key] =='user'){
+                    $cell->attributes['data-gtu'] = $item->id;
+ }
@developerck
developerck / git-diff
Created August 3, 2024 19:51
show all button in moodle question bank
[show all button]
--- a/question/classes/local/bank/view.php
+++ b/question/classes/local/bank/view.php
@@ -1374,7 +1374,12 @@ class view {
echo \html_writer::start_tag('div',
['class' => 'question_table', 'id' => 'question_table']);
$this->print_table($questions);
- echo \html_writer::end_tag('div');
+ echo \html_writer::end_tag('div');
+ if ($this->totalcount > $this->pagesize) {
@developerck
developerck / footer.js
Created August 3, 2024 19:47
service worker in moodle and imroving performance through static cache
@developerck
developerck / receommended apache conf
Created August 3, 2024 19:42
apache conf as per aws server size for moodle
##2x large
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 30
ServerLimit 600
MaxRequestWorkers 600
MaxConnectionsPerChild 5000
</IfModule>
@developerck
developerck / loopthrough.sh
Created August 3, 2024 19:33
running command in multiple directory considering parent directoty only.
#!/bin/bash
find . -maxdepth 1 -mindepth 1 -type d -name "*" | while read d; do
echo $d
## will replace utf8_general_ci to utf8mb4_unicode_ci
find $d/config.php -type f -exec sed -i -e 's/utf8_general_ci/utf8mb4_unicode_ci/g' {} \;
/usr/bin/php $d/admin/cli/mysql_collation.php --collation="utf8mb4_unicode_ci"
done
@developerck
developerck / command for msmpt
Created August 3, 2024 19:30
command for msmtp
## command line msmtp tool to test if smtp is working or not.
cat message.txt | msmtp --auth=on --tls=on \
--host smtp.gmail.com --port 587 \
--user abc@email.invalid \
--read-envelope-from --read-recipients
@developerck
developerck / export_moodle_question_answer.php
Created July 8, 2024 06:21
Export all question and correct answer in csv for moodle.
<?php
require_once 'config.php';
require_once($CFG->libdir.'/questionlib.php');
require_once($CFG->libdir.'/csvlib.class.php');
require_admin();
raise_memory_limit(MEMORY_HUGE);
ini_set('max_execution_time', 600);
$from = optional_param("from",0,PARAM_INT);
$to = optional_param("to",0,PARAM_INT);
$where= [] ;
@developerck
developerck / xdebug3_ docker_vscode_conf.md
Created January 12, 2024 03:05
xdebug3_ docker_vscode_conf.md
xdebug setup 7.4
    pecl install xdebug-3.1.6
    docker-php-ext-enable xdebug
add in xdebug.ini file
  [xdebug]
  xdebug.mode=develop,debug
  xdebug.client_port = 9095 ## any port number which is exposed
  xdebug.discover_client_host = 1

xdebug.idekey = VSCODE