Skip to content

Instantly share code, notes, and snippets.

View sdemjanenko's full-sized avatar

Stephen Demjanenko sdemjanenko

View GitHub Profile
@colelawrence
colelawrence / entity-durability-patterns.md
Last active December 16, 2025 18:38
Effect workflows entity durability patterns and comparison to temporal

Entity Durability Patterns in Effect Cluster

Understanding how state survives failures - and how to test it.

The Two Durability Concerns

When an entity "dies" (runner crashes, shard reassigned), there are two separate things to worry about:

Concern Question Effect Cluster Solution
@sindresorhus
sindresorhus / esm-package.md
Last active December 25, 2025 12:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@wyfo
wyfo / one_of.py
Last active October 14, 2022 20:10
GraphQL @OneOf directive implementation in Python using graphql-core
"""
This example shows an implementation of the @oneOf directive proposed here:
https://github.com/graphql/graphql-spec/pull/825.
It requires Python 3.9 and graphql-core 3.1.3 (https://github.com/graphql-python/graphql-core).
Although the directive support can be implemented out of the box when used in a field
definition, its use in input object type definition requires a specific graphql-core
feature custom output types of input object types
(https://graphql-core-3.readthedocs.io/en/latest/diffs.html#custom-output-types-of-input-object-types).
@noamsdahan
noamsdahan / passrole_actions_and_parameters.csv
Last active August 26, 2025 21:57
A list of IAM actions which require iam:PassRole as of December 2020. Nested parameters are written with dot ('.') notation. Where there are multiple relevant parameters, they are separated by the pipe character ('|'). consult the AWS documentation on special cases - noted with an asterisk (most of them are "array of documents" type parameters).…
IAM Permission Params
amplify:CreateApp iamServiceRoleArn
amplify:UpdateApp iamServiceRoleArn
appconfig:CreateConfigurationProfile RetrievalRoleArn
appconfig:UpdateConfigurationProfile RetrievalRoleArn
appflow:CreateConnectorProfile connectorProfileConfig.connectorProfileProperties.Redshift.roleArn
appflow:UpdateConnectorProfile connectorProfileConfig.connectorProfileProperties.Redshift.roleArn
application-autoscaling:RegisterScalableTarget RoleARN
apprunner:CreateService SourceConfiguration.AuthenticationConfiguration.AccessRoleArn|InstanceConfiguration.InstanceRoleArn
apprunner:UpdateService SourceConfiguration.AuthenticationConfiguration.AccessRoleArn|InstanceConfiguration.InstanceRoleArn
@andresriancho
andresriancho / query.sql
Created November 8, 2019 17:17
Athena query to get AWS Lambda function invoke calls
SELECT eventtime,
eventname,
requestparameters,
awsregion,
eventsource,
resources
FROM cloudtrail_662651605507
WHERE year = '2019'
AND month IN ('7', '8', '9', '10', '11')
AND eventsource = 'lambda.amazonaws.com'
@gricard
gricard / webpack4upgrade.md
Last active April 20, 2025 23:06
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@coryodaniel
coryodaniel / v_pg_stat_statements_helpers.sql
Created January 20, 2018 01:17
PG Stat Statements helpers
\set common_pct 0.1
\set common_slow 10
\set other_slow 100
CREATE MATERIALIZED VIEW v_pg_stat_statements AS
WITH totals AS (
SELECT sum(calls) as ttl_calls, sum(total_time) as ttl_time
FROM pg_stat_statements
)
SELECT
@robrichard
robrichard / react-relay.js
Created November 1, 2017 16:40
Mock for relay modern
import React from 'react';
import PropTypes from 'prop-types';
const relayMock = jest.genMockFromModule('react-relay');
const relayChildContextTypes = {
relay: PropTypes.object
};
const relayEnvironment = {
lookup: jest.fn()
@ahmetb
ahmetb / gcrgc.sh
Last active March 10, 2025 21:51
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software