Skip to content

Instantly share code, notes, and snippets.

@tejpochiraju
tejpochiraju / offline_caching.js
Created November 27, 2020 07:03
Example showing how to download large objects from S3 and cache using IndexedDB
// Example showing how to download large objects from S3 and cache using IndexedDB
// Once downloaded, all future requests for the file are automatically served from IndexedDB.
// Offline caching module -
import Dexie from 'dexie';
import axios from 'axios';
const db = new Dexie('offline-blobs');
db.version(1).stores({
blobs: 'key,id, blob'
@tejpochiraju
tejpochiraju / fastled.ino
Created July 16, 2021 12:42
Testing NeoPixel Array Using the mDuino-21+ Controller
#include <FastLED.h>
// LED_PIN = 2 works but 36 (Q0.0) does not.
#define LED_PIN 36
#define NUM_LEDS 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
@tejpochiraju
tejpochiraju / restore.py
Created June 25, 2021 04:10
SQLite3 Read replica using LitestreamIO
'''
Native read replicas might come soon to Litestream:
- https://github.com/benbjohnson/litestream/issues/15
While waiting for that, the following script does a good enough job.
Our use case is restoring the DB on a different node for use with Grafana.
'''
import boto3
import subprocess
import os
from datetime import datetime, timezone
defmodule ExAws.Iot do
# version: 2.0
# apiVersion: 2015-05-28
# endpointPrefix: iot
# protocol: rest-json
# serviceFullName: AWS IoT
# serviceId: IoT
# signatureVersion: v4
# signingName: execute-api
@tejpochiraju
tejpochiraju / openpgp.txt
Created September 30, 2017 08:10
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:dedc141b689553277cf708186116dce3df8fbd1c]
@tejpochiraju
tejpochiraju / openpgp.txt
Created September 30, 2017 08:10
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:dedc141b689553277cf708186116dce3df8fbd1c]