Enables plugins, and SQLite no-login.
- Copy
index.php
to a new directory - Download Adminer to
adminer.php
<VirtualHost *:80> | |
DocumentRoot /var/www/dirforbidden | |
<Directory /var/www/dirforbidden> | |
# Local machine only | |
Require local | |
# Broader local network | |
Require ip 192.168 | |
Require ip 10 | |
</Directory> |
(function() { | |
let overlay; | |
let node = document.elementFromPoint(window.innerWidth / 2, window.innerHeight / 2); | |
while (true) { | |
if (!node.parentNode || node.tagName === 'BODY') break; | |
const styles = getComputedStyle(node); | |
if (styles['overflow'] === 'hidden') { | |
overlay = node; | |
} |
<?php | |
/** | |
* Snippet showing how to create a record for a student as they are added to | |
* a cohort. Students will earn 0 points so to only creates their record. | |
* | |
* These files below must be implemented as part of an existing plugin, or | |
* a new one. Only the two files relevant to Level up! are displayed below. | |
*/ | |
{{! | |
This represents a theme's layout template. | |
To render the shortcode, simply call the renderer method defined in the renderer. | |
}} | |
<div> | |
{{{ output.block_xp_progress_bar }}} | |
</div> |
// Re. https://github.com/reduxjs/react-redux/issues/535 | |
// | |
// Here is a solution to access props derived from the state in mapDispatchToProps. | |
// | |
// I personally prefer this over those suggested in the issue above. | |
const unlockItem = () => null; // Replace with some redux action. | |
const Unlocker = props => { | |
return <button onClick={() => props.unlockItem(props.itemId)}>Unlock</button>; |
<?php | |
/** | |
* Manually award points. | |
* | |
* @param int $userid The ID of the target user. | |
* @param int $points The numbers of points to award. | |
* @param int $courseid The course ID to use, this has no effect in sitewide mode. | |
*/ | |
function block_xp_award_points($userid, $points, $courseid = 0) { | |
if (!class_exists('block_xp\di')) { |
define([], function() { | |
/** | |
* Throttler. | |
* | |
* @param {Number} delay The delay. | |
*/ | |
function Throttler(delay) { | |
this.delay = delay || 300; | |
this.timeout = null; | |
this.time = new Date(); |
import React, { useState } from 'react'; | |
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap'; | |
export default function MyTabs(props) { | |
const [activeTab, setActiveTab] = useState('1'); | |
return ( | |
<div> | |
<Nav tabs> | |
<NavItem> | |
<NavLink className={activeTab == '1' ? 'active' : ''} onClick={() => setActiveTab('1')}> |
import Axios from 'axios'; | |
import { setupCache } from 'axios-cache-adapter'; | |
import localforage from 'localforage'; | |
import find from 'lodash/find'; | |
import isEmpty from 'lodash/isEmpty'; | |
const CACHE_MAX_AGE = 2 * 60 * 60 * 1000; | |
// Extracting 'axios-cache-adapter/src/exclude' as importing it leads to webpack not compiling it. | |
function exclude(config = {}, req) { |