Skip to content

Instantly share code, notes, and snippets.

View armenr's full-sized avatar

Armen Rostamian armenr

View GitHub Profile
Atinux / sse.ts
Last active June 4, 2024 05:47
SSE endpoint example with Nuxt 3
// ~/server/api/sse.ts
export default defineEventHandler(async (event) => {
if (! return { disabled: true }
// Enable SSE endpoint
setHeader(event, 'cache-control', 'no-cache')
setHeader(event, 'connection', 'keep-alive')
setHeader(event, 'content-type', 'text/event-stream')
setResponseStatus(event, 200)


  • EKS Fargate profiles for <fargate-profile-namespace>. Guide
  • EKS Fargate coredns profile for coredns pods to run (create profile for kube-system namespace, refer guide from previous step)
  • EFS CSI Driver installed, mount points set and pv.yaml created. Refer Guide
  • EKS ALB Controller, refer Guide.

Install Helm

Refer Helm Installation to install helm command

ahuggins-nhs / DeepOmit.d.ts
Last active May 4, 2023 16:41
Deeply omit members of an interface or type
// Taken from
/** Union of primitives to skip with deep omit utilities. */
type Primitive = string | Function | number | boolean | Symbol | undefined | null
/** Deeply omit members of an array of interface or array of type. */
export type DeepOmitArray<T extends any[], K> = {
[P in keyof T]: DeepOmit<T[P], K>
rcugut / [GUIDE] macos yarn nvm
Last active July 10, 2023 11:49
GUIDE for mac OS X yarn nvm node install

GUIDE to install yarn, nvm (node) on macOS

last update: Dec 4, 2020


  • macOS >= 10.14 (Mojave); tested with 10.15 (Catalina)
  • homebrew properly installed

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.


timvisee /
Last active June 13, 2024 08:31
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.


  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
irvingpop /
Last active April 8, 2024 07:18
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
hamishrouse /
Last active March 8, 2024 18:30
Typescript, React and Video.js (VideoJS)
hassy / kms-vault
Last active December 29, 2023 04:11
Encrypt/decrypt files using AWS KMS
#!/usr/bin/env bash
# License: MIT -
# Usage:
# Encrypt a file:
# kms-vault encrypt My-Key-Alias some-file-i-want-encrypted.txt > topsecret.asc
eiriklv / avoiding-exceptions.js
Last active February 2, 2019 12:13
Exception free JavaScript?
* Check out error handling in golang:
* Wrap an "unsafe" promise
function safePromise(promise) {
return promise