Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
socket.emit - This method is responsible for sending messages. socket.on - This method is responsible for listening for incoming messages |
//Major Function | |
const MajorLazer = async () => { | |
if(NumberOfTasks != 0){ | |
//Set the check to true so interval which is running majorlazer fun become clear | |
//then don't run the majorlazer multiple times causing errors or makig multiple calls | |
check = true; | |
var count = 0; | |
var myTimer; |
Run pip install pipenv
to install pipenv
Run pipenv shell
to create an environment, if does not exist, and activate it.
Run pipenv install python_decouple whitenoise dj_database_url Pillow gunicorn
May take a while.
This should create two files: Pipfile
and Pipfile.lock
. Keep them in the project root.
//Our custom function to add uri into annotations | |
var pageUri = function () { | |
return { | |
beforeAnnotationCreated: function (ann) { | |
ann.uri = window.location.href; | |
} | |
}; | |
}; | |
//Init Annotatorjs | |
var app = new annotator.App() |
//Create annotations | |
app.post('/api/annotations/:name', (req, res) => { | |
//create a random id object for annotations | |
let id = uuidv4(); | |
const { | |
qoute, | |
ranges, | |
text | |
} = req.body; | |
const { |
app.get('/api/search/:name', (req, res) => { | |
const { | |
name | |
} = req.params; | |
db.find({ file_name: name }).then(doc => { | |
let annotations = []; | |
doc.forEach(n => { | |
annotations.push(n.rows); | |
}); | |
res.json({ |