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 / Moodle: Alternative login URL
Last active March 7, 2024 11:39
Moodle: Alternative login URL
1. Configurar parámetro: alternateloginurl con la URL alternativa
2. Crear un fichero (html/php) que contenga el siguiente código:
<form method="post" action="http://yoursite.com/login/index.php">
<fieldset>
<label for="username">Username:</label><input type="text" name="username" id="username" />
<label for="password">Password:</label><input type="password" name="password" id="password" />
</fieldset>
<fieldset>
<input type="submit" value="Login" />
@xyulex
xyulex / WordPress: Custom Post Type Generator
Created March 30, 2016 11:19
WordPress: Custom Post Type Generator
http://www.weareo3.com/wordpress-custom-post-type-generator/
@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
@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 / 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: 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 / 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 / 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: 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 / MOODLE: Restrict Archivos privados
Created May 16, 2017 14:55
MOODLE: Restrict Archivos privados
moodle:/user/manageownfiles