Skip to content

Instantly share code, notes, and snippets.

View ItsWendell's full-sized avatar

Wendell Misiedjan ItsWendell

View GitHub Profile
@ItsWendell
ItsWendell / segment-analytics.ts
Last active January 30, 2023 10:36
Segment Analytics client for Lambda with Fire & Forget support.
import { merge } from "lodash";
import { request } from "https";
import { v4 as uuidv4 } from "uuid";
export const name = "analytics-lamdba";
export const version = "0.1.2";
export type SegmentMessageTypes =
| "identify"
| "group"
@ItsWendell
ItsWendell / setCacheControl.ts
Created June 14, 2020 23:48
Helper function for setting cache control from HTTP server responses
import { ServerResponse } from "http";
interface CacheControlConfig {
sMaxAge?: number;
maxAge?: number;
staleWhileRevalidate?: boolean | number;
publicCache?: boolean;
privateCache?: boolean;
immutable?: boolean;
noCache?: boolean;
@ItsWendell
ItsWendell / algolia-places-component.js
Last active February 26, 2020 20:10
React Hooks: Algolia Places component with custom input field and support for initial value. (places.js)
import React, { useRef, useEffect } from 'react';
import places from 'places.js';
// Custom component for React implementation with Hooks for Places.js
const AlgoliaPlaces = ({
inputComponent = input,
placeholder,
options,
initialValue,