Skip to content

Instantly share code, notes, and snippets.

View xfchris's full-sized avatar
😎
Working from home

Christian Valencia xfchris

😎
Working from home
View GitHub Profile
@Adam-Kaplan
Adam-Kaplan / Dockerfile
Created April 14, 2022 10:43
AWS SAM CLI `local start-api` in docker-compose
# Starting from offical aws-cli container.
FROM amazon/aws-cli:2.5.5
# Adding some unzip tool
RUN yum install -y unzip
# Download fixed version -> unzip -> run install script
RUN curl -L https://github.com/aws/aws-sam-cli/releases/download/v1.46.0/aws-sam-cli-linux-x86_64.zip -o /tmp/aws-sam.zip \
&& unzip /tmp/aws-sam.zip -d /tmp/aws-sam \
&& /tmp/aws-sam/install
@DavidWells
DavidWells / serverless-function-reference-formats.yml
Created September 19, 2020 04:41
Various ways to reference function name and ARN in serverless.yml
function:
foo:
handler: index.handler
# Ways to reference function in serverless.yml
FunctionName: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service.name}-${self:provider.stage}-foo
FunctionName: !GetAtt FooLambdaFunction.Arn
FunctionName: !Sub "${AWS::StackName}-foo"
FunctionName: ${self:service.name}-${self:provider.stage}-foo
@donaldpipowitch
donaldpipowitch / example.tsx
Created November 6, 2019 07:43
Mock Upload Progress with axios-mock-adapter
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
const mock = new MockAdapter(axios);
// this mocks a request which is always at 40% progress
mock.onPost('/upload-1').reply((config) => {
const total = 1024; // mocked file size
const progress = 0.4;
if (config.onUploadProgress) {
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 26, 2025 05:11
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub