Skip to content

Instantly share code, notes, and snippets.

@tejpochiraju
tejpochiraju / fastled.ino
Created Jul 16, 2021
Testing NeoPixel Array Using the mDuino-21+ Controller
View fastled.ino
#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 Jun 25, 2021
SQLite3 Read replica using LitestreamIO
View restore.py
'''
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
View iot.ex
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 / offline_caching.js
Created Nov 27, 2020
Example showing how to download large objects from S3 and cache using IndexedDB
View offline_caching.js
// 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 / openpgp.txt
Created Sep 30, 2017
OpenKeychain Linked Identity
View openpgp.txt
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 Sep 30, 2017
OpenKeychain Linked Identity
View openpgp.txt
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]