Skip to content

Instantly share code, notes, and snippets.

jasonrdsouza / expenses_appscript.js
Last active Mar 3, 2021
Google AppsScript script to automate splitting expenses and sending a monthly email requesting payment
View expenses_appscript.js
* Script to automate sending the monthly debt emails.
var COLUMNS = {
"date": 0,
"paid": 1,
"total": 2,
jasonrdsouza / compressFolder.go
Created Feb 27, 2021
Demonstration of how to compress a folder and all of its contents in Go
View compressFolder.go
// Original source:
package main
import (
jasonrdsouza / smart_connect.go
Last active Feb 27, 2021
Simple HTTP server to intelligently route and multiplex requests over a collection of backing network connections
View smart_connect.go
// Small exploration into the ease of implementing an interface (and server) to abstract
// away the complexities of dealing with cumbersome and non-standardized network
// protocols.
// The resulting server exposes a simple HTTP API to clients, routing and forwarding
// their requests behind the scenes to a collection of raw network streams. The goal
// is to hide the underlying communication protocol and network multiplexing from
// clients, instead exposing a simple request/response API spoken in the lingua franca
// of the web.
jasonrdsouza /
Created Apr 24, 2020
Snippet to count contiguous islands in a grid
from collections import namedtuple
Node = namedtuple('Node', 'row col')
class IslandCounter:
def __init__(self, ocean_map): = ocean_map
self.max_row = len(ocean_map)
self.max_col = len(ocean_map[0])
jasonrdsouza / choose_winner.dart
Last active Jun 9, 2020
Dartpad Gist to Choose a Random Winner
View choose_winner.dart
import 'dart:math';
List<String> contestants = [
jasonrdsouza /
Created Jan 4, 2019
Snippet to pull thermostat info from the Nest API
import nest #
import configparser
config = configparser.ConfigParser()'config.ini')
napi = nest.Nest(client_id=config['NEST']['client_id'], client_secret=config['NEST']['client_secret'], access_token_cache_file='token_cache')
if napi.authorization_required:
print('Go to ' + napi.authorize_url + ' to authorize, then enter PIN below')
jasonrdsouza / GroceryLogic.dart
Last active Jul 7, 2018
Grocery List App Brainstorm
View GroceryLogic.dart
* The basic idea is to make a Grocery List progressive web app in Dartlang,
* using Firestore ( as the backend.
* This pad is a quick sketch of the logic necessary to get the app working.
enum Categories {
jasonrdsouza /
Created Dec 13, 2016
Helper script to quickly restart all of the instances of an app running in AWS under a load balancer
Helper script to quickly restart all of the instances of a specific app
Assumes lots of things about the setup of the app (load balancer, ssh access, supervisor, etc.)
import boto3
import subprocess
import argparse
def load_balancer_instances(name):
jasonrdsouza /
Created Nov 8, 2016
Simple Heap Implementation
class Heap:
def __init__(self): = []
self.length = 0
def push(self, val):
if len( <= self.length: # need to expand the array
else:[self.length] = val
jasonrdsouza /
Last active Feb 26, 2021
Export archived article data from Pocket
'''This script can be used to export data from Pocket (
Uses include migrating to a different "read it later" service, saving
specific articles to another service, backing up your reading history,
and more.
Currently it can be used to export links and metadata for archived
articles with a given tag, which are more recent than a given timestamp.
An example use case is to export all articles you have tagged as
"to-export", which are newer than 10 days old. The timestamp functionality