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 / gist:43ba3eb3255833a3ade3839632742ed2
Created April 26, 2017 08:51
Converting m4a files to mp3
$ sudo apt-get install faad lame
$ faad -o my.wav my.m4a
$ lame -h -b 256 my.wav my.mp3
@vaughany
vaughany / gist:9a7fb895012f9abd7ad675b887f17666
Created March 15, 2017 09:20
Alter table schema for course_modules
ALTER TABLE mdl_course_modules ALTER COLUMN idnumber TYPE varchar(65535);
@vaughany
vaughany / atom_plugins.md
Last active February 1, 2017 10:40
Useful Atom Plugins
@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
@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

<?php
namespace App\Shell;
use Cake\Console\Shell;
/**
* DummyData shell command.
*/
class DummyDataShell extends Shell
{
|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
// 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,
@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']
]);
@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' *