Skip to content

Instantly share code, notes, and snippets.

View taylortom's full-sized avatar
🛸
Working from home

Tom Taylor taylortom

🛸
Working from home
View GitHub Profile
var bcrypt = require('bcrypt-nodejs');
var usage = 'usage: node passwordgen.js <password>';
if (process.argv.length != 3) {
console.log(usage);
process.exit(1);
}
var plaintext = process.argv[2];
bcrypt.genSalt(10, function (err, salt) {

Missing strings

  • app.refresh: Refresh
  • app.usermanagementtitle: Manage System Users
  • app.addusertitle: Add new user
  • app.disableuser: Disable user
  • app.deleteuser: Delete user
  • app.unlockuser: Unlock user
  • app.restoreuser: Restore user
  • app.resetlogins: Reset logins
  • app.confirmresetlogins: Reset failed login attempts for <b>%{email}</b>?
diff --git a/plugins/output/adapt/import-transforms.js b/plugins/output/adapt/import-transforms.js
new file mode 100644
index 00000000..a128cfb4
--- /dev/null
+++ b/plugins/output/adapt/import-transforms.js
@@ -0,0 +1,85 @@
+const async = require('async');
+
+let courseId, metadata;
+
curl PATCH_URL | git apply -v
@taylortom
taylortom / dev.config.js
Last active August 13, 2019 10:45
Example config file
module.exports = {
'app': {
local_modules_path: "/Users/tom/Projects/adapt_authoring_restructure"
},
'adapt-authoring-logger': {
enabledLevels: ['error', 'warn', 'success', 'info', 'debug']
},
'adapt-authoring-mongodb': {
host: "localhost",
port: 27017,
@taylortom
taylortom / reqScopes.json
Last active October 21, 2019 13:53
Example auth scopes file
[
"read:auth",
"read:builds",
"read:config",
"read:courses",
"read:helloworld",
"read:lang",
"read:course",
"write:course"
]
@taylortom
taylortom / adapt.json
Created January 13, 2020 15:37
Example route handler config
{
"documentation": {
"enable": true
},
"api": {
"name": "courses",
"root": "/courses",
"middleware": "./lib/middleware.js",
"routeHandlers": "./lib/routes.js",
"routes": [
@taylortom
taylortom / MongoDBModule-examples.js
Last active April 13, 2022 17:40
MongoDBModule examples
/**
* General notes:
* - find is the only action which returns a cursor, the rest return a Promise
* - With the AbstractAPIModule, we've added some restrictions. Should we map these
* to also restrict MongoDBModule to these:
* - POST: only ever create one => insertOne
* - GET: with _id param, returns one, otherwise array => findOne/findMany
* - UPDATE: must provide _id, only ever update one => insertOne
* - PATCH: NO SUPPORT
* - DELETE: must provide _id, only ever update one => deleteOne
const { AbstractModule } = require('adapt-authoring-core');
const glob = require('util').promisify(require('glob'));
const JsonSchemaValidator = require('./jsonSchemaValidator');
const path = require('path');
/**
* Module which add support for the JSON Schema specification
* @extends {AbstractModule}
*/
class JsonSchemaModule extends AbstractModule {
/** @override */
@taylortom
taylortom / register-super.js
Last active October 13, 2022 12:31
Script to register a new super user account in AAT v1.0.0
import path from 'path';
import { pathToFileURL } from 'url';
import { spawn } from 'child_process';
/**
* Handles installing/removing the npm dependencies for this script
*/
function deps(command) {
return new Promise((resolve, reject) => {
let error = '';
const npm = spawn(`npm ${command} prompts`, { shell: true })