Skip to content

Instantly share code, notes, and snippets.

View mxro's full-sized avatar

Max Rohde mxro

View GitHub Profile
@mxro
mxro / package.json
Created March 10, 2021 20:31
Script for sitemap generation
...
"scripts": {
...
"generate-sitemap": "node sitemap-generator.js",
...
},
...
@mxro
mxro / index.tsx
Last active March 10, 2021 20:43
Example of adding title to a Next.js page
import Head from 'next/head';
const Index = (): JSX.Element => {
return (
<>
<Head>
<title>My Page title</title>
<meta property="og:title" content="My page title" key="title" />
</Head>
<h1>My page title</h1>
@mxro
mxro / index.tsx
Last active March 10, 2021 21:06
Example for adding description to Next.js page.
import Head from 'next/head';
const Index = (): JSX.Element => {
return (
<>
<Head>
<title>My Page title</title>
<meta property="og:title" content="My page title" key="title" />
<meta name="description" content="My description" />
<meta property="og:description" content="My description" />
@mxro
mxro / go.mod
Created April 17, 2021 03:25
Go module definition for Go Starter Project
module goldstack.party/templates/lambda-go-gin
go 1.16
require (
github.com/aws/aws-lambda-go v1.23.0
github.com/awslabs/aws-lambda-go-api-proxy v0.9.0
github.com/gin-contrib/cors v1.3.1
github.com/gin-gonic/gin v1.6.3
)
@mxro
mxro / main.go
Created April 17, 2021 03:28
Entry point for Go Lambda
package main
import (
"os"
"github.com/aws/aws-lambda-go/lambda"
)
func main() {
// when no 'PORT' environment variable defined, process lambda
package main
import (
"os"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func CreateServer() *gin.Engine {
{
"$schema": "./schemas/package.schema.json",
"name": "lambda-go-gin",
"template": "lambda-go-gin",
"templateVersion": "0.1.1",
"configuration": {},
"deployments": [
{
"name": "dev",
"configuration": {
{
"users": [
{
"name": "awsUser",
"type": "apiKey",
"config": {
"awsAccessKeyId": "[Access Key Id]",
"awsSecretAccessKey": "[Secret Access Key]",
"awsDefaultRegion": "us-west-2"
}
{
"compilerOptions": {
"composite": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"outDir": "./dist",
}
"references": [
{
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.eol": "\n",
"editor.formatOnSave": false
}