Skip to content

Instantly share code, notes, and snippets.

View ofhouse's full-sized avatar
🚀
Never Come Down.

Felix Haus ofhouse

🚀
Never Come Down.
View GitHub Profile
@ofhouse
ofhouse / next.config.js.diff
Created March 16, 2021 13:35
Changes to next.config.js needed for Terraform Next.js Image Optimization module for AWS.
module.exports = {
+ images: {
+ path: 'https://<distribution-id>.cloudfront.net/_next/image'
+ },
}
@ofhouse
ofhouse / main.tf
Last active August 30, 2021 18:36
Initialize Terraform Next.js Image Optimization module for AWS
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
# Main AWS region where the resources should be created in
@ofhouse
ofhouse / main.tf
Last active January 4, 2021 16:08
Initial Terraform template for Next.js module for AWS
# main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
@ofhouse
ofhouse / lambda-bridge.js
Last active January 4, 2021 14:44
Reference implementation how to start a Next.js webserver inside a Lambda from API Gateway invocation
// Reference implementation how to start a Next.js webserver inside a Lambda
// from API Gateway invocation
// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
const { request } = require('http');
// Import the generated Next.js server from somewhere
const NextServer = require('./dist');
exports.handler = async function (event) {
@ofhouse
ofhouse / install-java-versions.md
Created October 13, 2020 15:16
Install and manage multiple Java SDK versions on Ubuntu

Install and manage multiple Java versions on Ubuntu

This guide shows per example the installation of the Java SDK versions 8 (LTS, already installed) and 11 (LTS).

1. Check which Java versions are avaialable or already installed

apt --names-only search "openjdk-.*jre$"

> Sorting... Done
@ofhouse
ofhouse / curves.py
Last active December 30, 2019 17:45
Blender helper scripts
# Copies the length of the selected curve to the clipboard
import bpy
import subprocess
def copy2clip(txt):
cmd='echo '+str(txt).strip()+'|clip'
return subprocess.check_call(cmd, shell=True)
length = bpy.context.object.data.splines.active.calc_length()
copy2clip(length)
@ofhouse
ofhouse / PowerShell Autocomplete.md
Last active December 27, 2019 15:47
PowerShell bash-like autocomplete

Add bash-like autocomplete to PowerShell

  1. Add or open your PowerShell profile (to make the changes permanent)
ii $PROFILE.CurrentUserAllHosts
  1. Add the following lines
# Tab autocomplete
@ofhouse
ofhouse / README.md
Last active December 7, 2019 15:05
KeepassXC Browser NativeMessagingHosts

Missing org.keepassxc.keepassxc_browser.json on Ubuntu

After installing the KeepassXC Browser extension in Google Chrome, it failed to connect to the KeepassXC Application. Checking the ~/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json file as described in the Troubleshooting guide I noticed that the file is missing. So simple create this file and paste the content from the org.keepassxc.keepassxc_browser.json file from this gist and restart the browser to make it work again.

KeepassXC from snap store

When using KeepassXC from the snap store, it usually does not create the keepassxc-proxy binary, because it's keepassxc.proxy here. To fix this, create the file keepassxc-proxy in /usr/bin/keepassxc-proxy with the following content:

/* polyfills.js */
import 'react-app-polyfill/ie11';
import 'core-js/features/array/find';
import 'core-js/features/array/includes';
import 'core-js/features/number/is-nan';
@ofhouse
ofhouse / iconv-patch.js
Created March 18, 2019 11:19
Patch for the `encoding` npm-package to use with webpack. (From: https://github.com/andris9/encoding/issues/18#issuecomment-319721150)
// IIFE
(function() {
'use strict';
// node
var fs = require('fs');
var path = require('path');
// Patch encoding module due to iconv issues -> make it use iconv-lite