To install a custom package or modify an existing docker image we need to
- run a docker a container from the image we wish to modify
- modify the docker container
- commit the changes to the container as a docker image
- test changes made to image
-- | |
-- OCR all documents added to a folder | |
-- | |
on adding folder items to this_folder after receiving added_items | |
try | |
repeat with i from 1 to number of items in added_items | |
set this_item to item i of added_items | |
set appName to my getAppName() | |
tell application appName | |
activate |
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
var fs = require('fs'); | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws-config.json'); | |
var s3 = new AWS.S3(); | |
// File | |
var fileName = '5.pdf'; | |
var filePath = './' + fileName; | |
var fileKey = fileName; |
To install a custom package or modify an existing docker image we need to
var express = require('express') | |
var app = express() | |
var AWS = require('aws-sdk'); | |
var bodyParser = require('body-parser'); | |
var fs = require('fs'); | |
var zlib = require('zlib'); // gzip compression | |
var multiparty = require('connect-multiparty'), | |
multipartyMiddleware = multiparty(); |
module.exports.requestUploadURL = (event, context, callback) => { | |
var s3 = new AWS.S3(); | |
var params = JSON.parse(event.body); | |
var s3Params = { | |
Bucket: 'slsupload', | |
Key: params.name, | |
ContentType: params.type, | |
ACL: 'public-read', | |
}; |
This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.
These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.
Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm
This diagram has been taken from here and modified to include the Shelly 1.
Thanks to React hooks you have now happily turned all your classes into functional components.
Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.
There is just no functional equivalent for componentDidCatch
and deriveStateFromError
yet.
# how to run this thingy | |
# create a file on your mac called setup.sh | |
# run it from terminal with: sh setup.sh | |
# heavily inspired by https://twitter.com/damcclean | |
# https://github.com/damcclean/dotfiles/blob/master/install.sh | |
# faster dock hiding/showing (run in terminal) | |
# defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock |
require('dotenv').config(); | |
const express = require('express'); | |
const app = express(); | |
const cors = require('cors'); | |
const bodyParser = require('body-parser'); | |
const { Storage } = require('@google-cloud/storage'); | |
const multer = require('multer'); | |
const port = process.env.API_PORT || 8080; | |
app.use(bodyParser.json()); |
version: '2' | |
services: | |
mauticdb: | |
image: percona/percona-server:5.7 | |
container_name: mauticdb | |
volumes: | |
- mysql_data:/var/lib/mysql | |
environment: |