Skip to content

Instantly share code, notes, and snippets.

@andreburto
andreburto / shadow.html
Created October 17, 2020 20:24
Shadow DOM tinkering
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shadow</title>
<script>
function addShadow() {
const theDiv = document.getElementById("theDiv2")
const shadowRoot = theDiv.attachShadow({mode: 'open'})
const para = document.createElement("p")
@andreburto
andreburto / upload-image.js
Created March 8, 2021 16:58
Node.js script to upload images to an S3 bucket.
const fs = require("fs")
const AWS = require('aws-sdk');
const bucketPath
const main = (imgPath) => {
fs.stat(imgPath, function(err, stats) {
if (!stats.isDirectory()) {
throw new Error(`"${imgPath}" is not a directory.`)
}
@andreburto
andreburto / toys.py
Last active November 22, 2022 12:47
#!/usr/bin/env python3
#####
import argparse
import sys
class MyToys:
@classmethod
def setup_args(cls, subparsers):
@andreburto
andreburto / index.html
Created July 10, 2022 23:00
Tiny web server that can eventually run on my phone.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Server</title>
</head>
<body>
<h1>Server</h1>
<p>This is a test.</p>
</body>
import argparse
import boto3
from datetime import datetime
DEFAULT_REGION = "us-east-1"
DEFAULT_RESOURCE_LIST = ["arn:aws:s3:::cow.mothersect.info",
"arn:aws:lambda:us-east-1:441882069681:function:YvonneGo", ]