Skip to content

Instantly share code, notes, and snippets.

View seanmonstar's full-sized avatar

Sean McArthur seanmonstar

View GitHub Profile
### Keybase proof
I hereby claim:
* I am seanmonstar on github.
* I am seanmonstar (https://keybase.io/seanmonstar) on keybase.
* I have a public key whose fingerprint is 4510 C329 1E45 1DA3 FEB8 DDA8 3EE3 A12F 7DE2 F7F3
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am seanmonstar on github.
* I am seanmonstar_yolo (https://keybase.io/seanmonstar_yolo) on keybase.
* I have a public key whose fingerprint is AD0A 9E82 77A1 BD20 E37F 9536 D663 E992 A8C8 EAC3
To claim this, I am signing this object:
@seanmonstar
seanmonstar / budget.ts
Created October 5, 2021 14:02
TypeScript Retry Budget
import { strict as assert } from "assert";
type BudgetOptions = {
ttlInSeconds: number,
minPerSecond: number,
retryPercent: number,
now?: () => number,
}
export class RetryBudget {
@seanmonstar
seanmonstar / client.rs
Created February 7, 2018 23:36
hyper v0.12 client example
extern crate hyper;
extern crate tokio;
use tokio::executor::current_thread;
fn main() {
// uses default Handle, the global loop
let client = hyper::Client::new();
current_thread::run(|_| {
@seanmonstar
seanmonstar / server.rs
Last active February 22, 2017 17:58 — forked from GuillaumeGomez/server
#![deny(missing_docs)]
#![deny(warnings)]
//! A simple HTTP server based on a REST API.
//!
//! You can perform the following actions:
//!
//! * `GET: /[key]`: returns the value corresponding to [key].
//! * `POST: /[key]`: create a new entry or update it with the given value passed in the body.
//! * `DELETE: /[key]`: remove the corresponding [key] from the server.
struct Shared<T>(mpsc::Sender<T>);
impl Clone for Shared<T> {
fn clone(&self) -> Shared<T> {
Shared(self.0.clone())
}
}
impl<T> Shared<T> {
pub fn new(tx: mpsc::Sender<T>) -> Shared<T> {
@seanmonstar
seanmonstar / pipe.rs
Created October 28, 2015 20:28
proposed async io for hyper
fn handle(req: Request, res: Response) {
// assuming `POST /echo`
req.pipe(res).on_error(|err| error!("pipe error: {}", err));
}
@seanmonstar
seanmonstar / reporter.js
Last active August 29, 2015 14:02
using multiple reporters with mocha
var dots = require('mocha/lib/reporters/dot');
var cov = require('mocha-text-cov');
module.exports = function reporter(runner, opts) {
new dots(runner, opts);
new cov(runner, opts);
};

Keybase proof

I hereby claim:

  • I am seanmonstar on github.
  • I am seanmonstar (https://keybase.io/seanmonstar) on keybase.
  • I have a public key whose fingerprint is 7C87 BA6A 4BB0 C5AE AF02 5E38 57FA D5E4 92D1 AE47

To claim this, I am signing this object:

@simevidas: @seanmonstar I've come up with some questions: https://t.co/rlG2ZHLOXO (Context: https://t.co/5UBSoYmcKv)

Is it possible to use an email address from your own domain for Persona? (E.g. if John Smith owns the domain smith.com and creates the email address john@smith.com, can he use that address for Persona?) If yes, how to set it up? Which config is required on your web/email server?

Yep. If John does nothing, then he can use john@smith.com with Persona by verifying an email from Persona, and creating a password in the dialog. If John wants to own his login experience, he can set up his domain to be an Identity Provider: https://developer.mozilla.org/en-US/Persona/Identity_Provider_Overview

How does Persona remember your e-mail address? Where is that stored? (E.g. when I click “login with email” and the Persona popup has my gmail address pre-selected - How does Persona know this information? Is it kept on Persona’s server or in my browser somewhere?)

The relationship of which email you