Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# Sends an AMP email from a Gmail account.
import smtplib
from email import encoders
from email.mime.text import MIMEText
@fstanis
fstanis / amp-validator-query.js
Created July 4, 2019 15:08
Query AMP HTML ⚡ Validator JSON rules
// Copyright 2019 Google LLC.
// SPDX-License-Identifier: Apache-2.0
/**
* This example demonstrates how to query the AMP validator rules hosted on the
* AMP CDN.
*
* It lists all tags allowed in the AMP4EMAIL spec.
*/
@fstanis
fstanis / multipart_email.py
Created November 5, 2018 19:19
Sends a multipart/alternative email containing 3 parts: text/plain, text/html and text/x-other.
#!/usr/bin/python3
# Copyright 2018 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# Sends a multipart/alternative email containing 3 parts: text/plain, text/html and text/x-other.
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

Keybase proof

I hereby claim:

  • I am fstanis on github.
  • I am fstanis (https://keybase.io/fstanis) on keybase.
  • I have a public key whose fingerprint is F7FA 3DE1 71A3 478D AD6A 3C13 7750 9C4A 238E 5BA4

To claim this, I am signing this object:

@fstanis
fstanis / bitset.go
Created January 21, 2018 21:28
Simple map-backed bitset in Go
package bitset
import "errors"
// BitSet represents a set of booleans.
type BitSet struct {
buckets map[int]byte
}
// New creates a new BitSet.
@fstanis
fstanis / app.js
Created October 15, 2017 22:00
Webpack ProvidePlugin polyfill guard bug
console.log(mdl);