Skip to content

Instantly share code, notes, and snippets.

View RikudouSage's full-sized avatar

Rikudou_Sage RikudouSage

View GitHub Profile
FROM golang:1.24 AS build
WORKDIR /build
COPY . .
RUN go mod tidy && CGO_ENABLED=0 go build -o /app .
FROM alpine:3
ENV APP_IP=0.0.0.0
COPY --from=build /app /app
ENTRYPOINT ["/app"]
<?php
// the function reads the comment added after the function is called using a backtrace and uses them as arguments
function add(): float
{
$trace = debug_backtrace();
$file = $trace[0]['file'];
$line = $trace[0]['line'];
$content = file($file);
@RikudouSage
RikudouSage / api_serverless.yml
Last active August 24, 2021 02:53
serverless.yml complex example
service: invoice-api # the service name, used as a prefix for all resources
package: # the packaging config
individually: true # this means that every function will be packaged separately and can define its own inclusion/exclusion rules
exclude:
- .idea/**
- var/cache/dev/**
- var/dev.log
- .gitlab-ci.yml
- .php_cs.dist
- .phpstorm.meta.php
@RikudouSage
RikudouSage / 01-magick-net-aws-lambda.md
Last active June 19, 2018 12:20
How To Compile Magick.NET native for AWS Lambda

How To Compile Magick.NET native for AWS Lambda

So you want to use Magick.NET on AWS Lambda? Well, not as simple as it sounds. Fortunatelly for you, here is a step by step guide to use Magick.NET on AWS Lambda.

Prepare

Create an Amazon Linux instance used for building.

Preferably choose some bigger instance so the build process is quick. (I used c4.xlarge). You can create it as a spot instance to save some coins, after the process