Skip to content

Instantly share code, notes, and snippets.

View xyulex's full-sized avatar

Raúl Martínez xyulex

View GitHub Profile
@xyulex
xyulex / scorm_create.sh
Last active June 21, 2023 04:28
MOODLE SCRIPT: Crear SCORMS con imsmaanifest.xml, añadiendo el xml a la carpeta html y comprimiendo carpetas en zips
#!/bin/bash
for i in *;
do
if [ -d "$i" ]; then
cd "$i";
for j in *;
do
if [ -d "$j" ]; then
@xyulex
xyulex / bc.php
Created May 31, 2017 13:21
MOODLE: CLI delete courses
#!/usr/bin/php
<?php
define('CLI_SCRIPT', true);
require_once('/var/www/html/altamar/config.php');
require_once('/var/www/html/altamar/course/lib.php');
// to delete a specific course id
if (isset($argv[1])) {
@xyulex
xyulex / MOODLE: Restrict Archivos privados
Created May 16, 2017 14:55
MOODLE: Restrict Archivos privados
moodle:/user/manageownfiles
@xyulex
xyulex / MOODLE: Importar SCORMS
Last active July 14, 2017 09:54
MOODLE: Importar SCORMS
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@xyulex
xyulex / TinyMCE: Eliminar botónes de selector de H1,H2....
Created January 20, 2017 08:33
TinyMCE: Eliminar botónes de selector de H1,H2....
<?php
// Do NOT include the opening php tag above
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' );
/*
* Modify TinyMCE editor to remove H1.
*/
function tiny_mce_remove_unused_formats($init) {
// Add block format elements you want to show in dropdown
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre';
return $init;
@xyulex
xyulex / MOODLE: Retocar plantilla de desgar en XLS, ODT....
Created January 12, 2017 12:02
MOODLE: Retocar plantilla de desgar en XLS, ODT....
Retocar en /lib/templates/dataformat_selector.mustache
@xyulex
xyulex / GIT: No mirar cambios de permisos
Created December 13, 2016 11:34
GIT: No mirar cambios de permisos en ficheros modificados
git config --global core.filemode false
@xyulex
xyulex / WordPress: desactivar actualización plugin
Created October 25, 2016 07:06
WordPress: desactivar actualización plugin
function disable_filter_plugin_updates( $value ) {
unset( $value->response['read-offline/read-offline.php'] );
return $value;
}
add_filter( 'site_transient_update_plugins', 'disable_filter_plugin_updates' );
@xyulex
xyulex / Git: evitar que pregunte user y password cada vez
Created October 20, 2016 13:10
Git: evitar que pregunte user y password cada vez
git config --global credential.helper store
@xyulex
xyulex / JSON
Last active June 8, 2016 09:20
jQuery: Search string in directory without database.
This file has been truncated, but you can view the full file.
[{
"url": "s1/1_1_1.html",
"sourceCode": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\"\r\n\"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>Els nombres</title>\r\n<link href=\"../css/estils.css\" type=\"text/css\" rel=\"stylesheet\"></link>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/matematiques.css\"></link>\r\n<!--[if gte IE 5.5]><![if lt IE 7]>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/ie.css\"></link>\r\n<![endif]><![endif]-->\r\n<script language=\"JavaScript1.2\" src=\"../js/loadingxml.js\"></script>\r\n<script language=\"JavaScript1.2\" src=\"../js/uocViewer.js\"></script>\r\n<script language=\"JavaScript1.2\" src=\"../js/params.js\"></script>\r\n<script language=\"JavaScript1.2\" src=\"../js/highligth_function.js\"></script>\r\n<script type=\"text/javascript\" src=\"../especial/MathMLinHTMLforFirefoxAndI