Skip to content

Instantly share code, notes, and snippets.

@gdagley
gdagley / EventStack.ts
Created November 8, 2023 13:48
Simplify adding EventBus rules to SST
import {Config, EventBus, EventBusRuleProps, Queue, Stack, StackContext, Table} from "@serverless-stack/resources";
const snakeToCamel = (s: string) => s.replace(/(_\w)/g, k => k[1].toUpperCase());
const addBusinessRule = (stack: Stack, bus: EventBus, dlq: Queue, eventType: string) => {
const ruleKey = eventType.replace(".", "_");
const queueName = `${ruleKey}_queue`;
const handlerLambda = `functions/events/${snakeToCamel(ruleKey)}/handler.main`;
const rules: Record<string, EventBusRuleProps> = {};
@gdagley
gdagley / main.dart
Created December 21, 2020 19:21
showTimePicker is not working on iOS, but does on Android.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@gdagley
gdagley / .gitignore
Created October 3, 2017 14:18 — forked from FullStackForger/.gitignore
.gitignore for Unity3d project
###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
#!/bin/bash
# prompt themeing
function current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
@gdagley
gdagley / smart_tools.md
Created October 13, 2011 13:37
Notes from "Getting smarter with Geof" at ZWF Offsite 10/2011