Skip to content

Instantly share code, notes, and snippets.

View micksatana's full-sized avatar

Satana Charuwichitratana micksatana

View GitHub Profile
@micksatana
micksatana / hibernation-workflow.asl.json
Created June 24, 2022 18:22
Step Functions - State Machine JSON Definition to Start/Stop/Hibernate EC2 Instances
{
"Comment": "Hibernation Workflow",
"StartAt": "SwitchAction",
"States": {
"SwitchAction": {
"Type": "Choice",
"Choices": [
{
"Variable": "$$.Execution.Input.action",
"StringEquals": "hibernate",
@micksatana
micksatana / singleton-example.js
Created October 31, 2020 03:56
Example - Singleton DP in Node.js
/**
* This is a mocked connection class. Think of it like a class to create a connection to database.
*/
class Connection {
status = '';
constructor() {
console.log('instantiated');
this.status = 'connected';
console.log(this.status);