Taken from StackExchange
Thanks to LangLangC
For temperature and other improvements see https://gist.github.com/cdleon/d16e7743e6f056fedbebc329333d79df
from flask import Flask, request | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine | |
from sqlalchemy.future import select | |
from sqlalchemy.orm import declarative_base, sessionmaker | |
engine = create_async_engine('sqlite+aiosqlite:///./db.db') | |
async_session = sessionmaker( | |
engine, expire_on_commit=False, class_=AsyncSession | |
) |
version: '3.4' | |
services: | |
cache-redis: | |
image: 'redis:6-alpine' | |
container_name: cache-redis | |
environment: | |
REDIS_HOST: ${REDIS_HOST} | |
REDIS_DEFAULT_USER: ${REDIS_DEFAULT_USER} | |
REDIS_DEFAULT_PASS: ${REDIS_DEFAULT_PASS} | |
ports: |
Taken from StackExchange
Thanks to LangLangC
For temperature and other improvements see https://gist.github.com/cdleon/d16e7743e6f056fedbebc329333d79df
# Alfresco users | |
curl -s -u user:pass http://localhost:8080/alfresco/service/api/people | jq '.people[] .userName' | |
curl -s -u user:pass http://localhost:8080/alfresco/service/api/people | jq '.people[] | "\(.userName),\(.firstName),\(.lastName),\(.email)"' | |
# Alfresco groups | |
curl -s -u user:pass http://localhost:8080/alfresco/service/api/groups | jq '.data[] .shortName' | |
curl -s -u user:pass http://localhost:8080/alfresco/service/api/groups | jq '.data[] | "\(.shortName),\(.fullName),\(.displayName)"' |
bonus tip: for more darkness > https://darkreader.org/
These are generic npm scripts that you can copy & paste into your package.json
file as-is and get access to convinience scripts to manage your Docker images all in one place.
npm i -g mrm-task-npm-docker
npx mrm npm-docker
Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
// Create a Promise that resolves after ms time | |
var timer = function(ms) { | |
return new Promise(resolve => { | |
setTimeout(resolve, ms); | |
}); | |
}; | |
// Repeatedly generate a number starting | |
// from 0 after a random amount of time | |
var source = async function*() { |