Skip to content

Instantly share code, notes, and snippets.

View unfunco's full-sized avatar

Daniel Morris unfunco

View GitHub Profile
@unfunco
unfunco / bootstrap-terraform.yaml
Last active May 20, 2022 22:18
CloudFormation template for bootstrapping a Terraform state bucket and DynamoDB locks table in AWS.
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation stack used to bootstrap Terraform.
Resources:
TerraformStateBucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
BucketEncryption:
ServerSideEncryptionConfiguration:
@unfunco
unfunco / better-ide-suggestions-serverless-typescript.md
Last active April 30, 2023 18:11
Improved IntelliSense for Serverless and TypeScript

Improved IntelliSense for Serverless and TypeScript

The aws-nodejs-typescript template provided by the [Serverless Framework] scaffolds Lambda functions in such a way that it's difficult for an IDE to infer types correctly. For example, the following code defines a Lambda function as a plain object literal, this is what is generated when creating a new service.

import { handlerPath } from '@libs/handler-resolver'
@unfunco
unfunco / symfony.rake
Created September 6, 2017 09:38
Rake tasks for Symfony console commands
require 'json'
# Retrieves all the available Symfony console commands and creates a Rake task
# for each. In it's current generic state, this proxies the Rake task to the
# Symfony console, but this can be changed easily to execute the command within
# a containerised or virtualised environment.
SF_CONSOLE_COMMANDS = JSON.parse(`bin/console list --format=json`)['commands']
SF_CONSOLE_COMMANDS.each do |command, _|
task_name, task_description = command.values_at('name', 'description')
desc task_description
Yes
   ▄▄  ▄      
▄ ▄▄▄▄▄ ▄ ▄   ▄    
▄▄ ▄▄▄▄▄▄▄ ▄  ▄    ▄▄ 
▄▄ ▄▄▄▄ ▄