Skip to content

Instantly share code, notes, and snippets.

View willianmano's full-sized avatar
🎯
Focusing

Willian Mano willianmano

🎯
Focusing
View GitHub Profile
@willianmano
willianmano / clearquestionbank.php
Last active October 19, 2024 22:25
A script to remove unused questions from Moodle question bank.
<?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
<?php
namespace Valet\Drivers\Custom;
use Valet\Drivers\LaravelValetDriver;
class MoodleValetDriver extends LaravelValetDriver
{
protected $isStyleUri = false;
protected $baseUri = '';
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /opt/homebrew/etc/nginx/ssl/{{host}}.crt;
ssl_certificate_key /opt/homebrew/etc/nginx/ssl/{{host}}.key;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name {{host}};
root {{root}};
server {
listen 80;
server_name {{host}};
root {{root}};
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
<?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
@willianmano
willianmano / main.mustache
Created November 27, 2018 13:43
Customização do block myoverview Moodle 3.5
{{!
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
@willianmano
willianmano / purge_caches.php
Last active October 1, 2018 13:02
Moodle purge chaches with --theme option
<?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
@willianmano
willianmano / Lottery.sol
Created September 5, 2018 13:39
A Lottery Solidity Smart Contract
pragma solidity ^0.4.21;
contract Lottery {
address public manager;
address[] public players;
constructor() public {
manager = msg.sender;
}
@willianmano
willianmano / events.php
Created May 21, 2018 12:16
Moodle redirects after login
<?php
// File located in the DB folder
$observers = array(
array(
'eventname' => '\core\event\user_loggedin',
'callback' => 'yourplugin_dashboard_redirect',
'includefile' => 'yourplugin/localib.php'
)
@willianmano
willianmano / moodle
Created April 19, 2018 10:58
Moodle cron
* * * * * www-data /usr/local/bin/run_moodle_cron_tasks