Skip to content

Instantly share code, notes, and snippets.

Avatar

Tristan Slominski tristanls

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am tristanls on github.
  • I am tristanls (https://keybase.io/tristanls) on keybase.
  • I have a public key ASBa6_-Unbrn-U6KcZ0BDRic8CiEH6rfCm6LyTDKDa9xOAo

To claim this, I am signing this object:

View non_interactive_java_download.md
$ curl -LO -b "oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.tar.gz
@tristanls
tristanls / serverless_contexts.md
Created Aug 29, 2017
Contexts where Serveless was useful or not.
View serverless_contexts.md

Contexts where Serverless turned out useful:

  • When setting up a service control plane (for example commands such as CreateTenant, or DeleteTenant) Serverless is useful as the commands aren't executed often, and the latency is not really a constraint.
  • Processing events from an event stream up to a certain throughput when cost starts to dominate and running dedicated servers (which possibly is "roll your own serverless") becomes a more economical choice.

Contexts where Serverless didn't work well:

  • When setting up a service data plane (for example, proxying a request with minimal latency), Serverless doesn't work well
@tristanls
tristanls / Capability URI Scheme.md
Last active Jun 27, 2017
Capability URI Scheme
View Capability URI Scheme.md

Capability URI Scheme

The "cpblty" scheme is used to identify capabilities.

There are two types of "cpblty" URIs. They are distinguished by the mechanism used to identify the authority responsible for resolving the capability.

The first type of capability URI uses IP address or DNS resolution to identify authority.

@tristanls
tristanls / secure-local-storage-demo.js
Created Jun 19, 2016
Demo of securing local storage with encryption.
View secure-local-storage-demo.js
"use strict";
const crypto = require("crypto");
const http = require("http");
const url = require("url");
const indexHtml =
`<!doctype html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"><![endif]-->
View gist:b47430985858978669b7
{
"message": "hello there",
"status": "200 OK"
}
View gist:fbb69eb45feb5c84649e
  1. General Background and Overview
@tristanls
tristanls / iso8601durationregex.js
Last active Sep 6, 2021
ISO-8601 Duration Regex
View iso8601durationregex.js
var iso8601durationregex = /^P([0-9]+(?:[,\.][0-9]+)?Y)?([0-9]+(?:[,\.][0-9]+)?M)?([0-9]+(?:[,\.][0-9]+)?D)?(?:T([0-9]+(?:[,\.][0-9]+)?H)?([0-9]+(?:[,\.][0-9]+)?M)?([0-9]+(?:[,\.][0-9]+)?S)?)?$/
View gist:d90751faa1142d38df46
dostuffEmitter.on('task1', function (callback) {
dostuffEmitter.emit('task3', x, callback);
});
dostuffEmitter.on('task2', function (x, callback) {
dostuffEmitter.emit('finish', y, callback);
});
dostuffEmitter.on('task3', function (y, callback) {
dostuffEmitter.emit('task2', z, callback);
View gist:f86d7c0989230db927a9
dostuffEmitter.on('task2', function (x, callback) {
if (error) {
dostuffEmitter.emit('error', error);
return;
}
dostuffEmitter.emit('telemetry', someMetricHere);
dostuffEmitter.emit('task3', y, callback);
});