This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cors = require('cors') | |
var fs = require('fs') | |
var bodyParser = require('body-parser') | |
var express = require('express'), | |
app = express(), | |
port = process.env.PORT || 8080; | |
app.use(cors()) | |
app.use(bodyParser.json()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tradfriLib = require("node-tradfri-client"); | |
const TradfriClient = tradfriLib.TradfriClient; | |
const AccessoryTypes = tradfriLib.AccessoryTypes; | |
const tradfri = new TradfriClient("192.168.100.101"); | |
const lightbulbs = {}; | |
const plugs = {}; | |
const devices = {}; | |
const connect = async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
cd /mnt/usb/ | |
for d in */; do | |
echo $d | |
if [ ! -d "$d/thumbs" ]; then | |
echo "generating thumbs" | |
exiftool -b -PreviewImage -w "$d/thumbs/%f.jpg" -ext CR2 -r "$d" | |
exiftool -tagsfromfile "$d/%f.CR2" -all:all -r -overwrite_original -ext jpg "$d/thumbs" | |
mogrify "$d/thumbs/*.jpg" -resize 2000x "$d/thumbs/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const config = { | |
region: AWS.config.region || process.env.SERVERLESS_REGION || 'eu-west-1', | |
}; | |
const dynamodb = new AWS.DynamoDB.DocumentClient(config); | |
class BlogStorage { | |
constructor() { |