Skip to content

Instantly share code, notes, and snippets.

View vaughany's full-sized avatar
🎢
Operating from an interim headquarters

Paul Vaughan vaughany

🎢
Operating from an interim headquarters
View GitHub Profile
@vaughany
vaughany / base.css
Created September 10, 2014 16:21
Additions to Archaius' base.css to sort out tab issues
.tabtree .tabrow0 li a {
border-width: 0;
padding-right: 3px;
}
@vaughany
vaughany / isotope
Last active August 29, 2015 14:07
Isotope testing
<?php
$colours = array(
'red' => 'd00',
'green' => '0d0',
'blue' => '00d',
'cyan' => '0dd',
'magenta' => 'd0d',
'yellow' => 'dd0',
'orange' => 'd80',
@vaughany
vaughany / SQL snippet - Moodle Scheduler plugin timezone correction
Last active August 29, 2015 14:18
Moodle 2.x Scheduler plugin timezone correction (GMT +00:00 to BST +01:00)
UPDATE mdl_scheduler_slots AS ms, mdl_scheduler_slots AS mss
SET ms.starttime = mss.starttime - 3600
WHERE ms.id = mss.id
@vaughany
vaughany / todo.sh
Created April 17, 2015 09:22
Bash scripts, tips, hits and quick wins
#!/bin/bash
clear
echo -e "\n\e[1;36mTODO Finder: \e[0;36mSummary\e[0m"
grep -iIlr --color --exclude="todo.sh" 'todo' *
echo -e "\n\e[1;36mTODO Finder: \e[0;36mDetails\e[0m"
grep -iInr --color --exclude="todo.sh" 'todo' *
@vaughany
vaughany / PlansController.php
Last active August 29, 2015 14:22
CakePHP 3 code snippets
public function view($id = null) {
$plan = $this->Plans->get($id, [
'contain' => ['Subjects', 'Modules', 'Plantypes', 'Questions', 'Questions.Subjects', 'Questions.Modules', 'Questions.Questiontypes', 'Questions.Questionlevels', 'Questions.Students']
]);
....
$plan = $this->Plans->get($id, [
'contain' => ['Subjects', 'Modules', 'Plantypes', 'Questions', 'Students', 'Students.Questions', 'Students.Questions.Questiontypes', 'Students.Questions.Questionlevels']
]);
// Database schema
CREATE TABLE users (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
firstname VARCHAR(50) NOT NULL,
lastname VARCHAR(50) NOT NULL,
avatar VARCHAR(200) NOT NULL,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL,
|Review of your Personal Development
Review of attendance and punctuality.
Review your personal development including Skills +.
Review your work experience and development of employability skills.
Review any support needs.
|Review of your Core Qualification(s)
Your target grade is...
You are currently working at...
What actions are you taking to achieve your target grade or further improve your skills and knowledge?
|Review of your English
<?php
namespace App\Shell;
use Cake\Console\Shell;
/**
* DummyData shell command.
*/
class DummyDataShell extends Shell
{
@vaughany
vaughany / 01_Laravel 5 Simple ACL manager_Readme.md
Created May 16, 2016 11:32 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@vaughany
vaughany / desc.txt
Created November 15, 2016 09:25
Moodle 3.1 user table fields
id autogenerated - ignore
auth must equal "manual" (for the time being at least)
confirmed must equal 1
policyagreed must equal 0
deleted must equal 0
suspended must equal 0
mnethostid must equal 1
username Moodle will most likely have rules for what can and cannot go in here, but it's probs lowercase alphanum only, plus underscores.
password Moodle will have a function to hash this properly, don't write your own!
idnumber CiaB OS ID