Skip to content

Instantly share code, notes, and snippets.

View abeisgoat's full-sized avatar

Abe Haskins abeisgoat

View GitHub Profile
@abeisgoat
abeisgoat / app.js
Last active April 19, 2023 19:21
Simplit - Simplest, Tool-less Lit boilerplate
import {
LitElement,
html,
css,
} from "https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js";
export class SimpleGreeting extends LitElement {
static properties = {
name: {},
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Starter Snowpack App" />
<title>Starter Snowpack App</title>
<script type="module" src="/index.js"></script>
</head>
<body>
#!/usr/bin/env node
const { spawn } = require("child_process");
const util = require("util");
const exec = util.promisify(require("child_process").exec);
const { writeFileSync } = require("fs");
const chalk = require("chalk");
const COMMAND_PREFIX = ";;";
const COMMANDS = {
{"names": [
"A Nova",
"Abbasak",
"Aberdeen",
"Abner Cay",
"Abruka",
"Absecon",
"Abu Musa",
"Acheron",
"Achill",
const net = require("net")
const path = require("path")
const pipePath = process.platform == "win32" ? path.join('\\\\?\\pipe', process.cwd(), 'huh') : "./huh.pipe";
(async () => {
await delay(3000);
console.log("C: Attempting to connect")
const client = net.connect(pipePath);
client.on('data', function(data) {
console.log("S->C:", data.toString());
const admin = require("admin");
function getFirebaseUser(req, res, next) {
console.log("Check if request is authorized with Firebase ID token");
if (
!req.headers.authorization ||
!req.headers.authorization.startsWith("Bearer ")
) {
console.error(
"No Firebase ID token was passed as a Bearer token in the Authorization header.",
@abeisgoat
abeisgoat / Caddyfile
Created February 8, 2017 02:34
caddy-ssl-proxy
:443
gzip
log /var/log/access.log
proxy / mafia {
header_upstream Host {host}
}
tls {
max_certs 100000
}
@abeisgoat
abeisgoat / main.go
Last active August 9, 2016 18:54
Connect to the Firebase Realtime Database in Golang using the Google API *http.Client
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@abeisgoat
abeisgoat / example.html
Last active July 19, 2016 19:18
Firebase Storage + Imgix
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Imgix / Firebase Storage</title>
<script src="https://www.gstatic.com/firebasejs/3.2.0/firebase.js"></script>
<script>
var IMGIX_REDIRECT_URL = "";
var config = {
//...
@abeisgoat
abeisgoat / annotate.sh
Created February 27, 2016 11:33
Google Vision Shell Script
#!/usr/bin/env bash
####################################################
## Google Vision API Client ##
####################################################
#
# 1. Create "key" file with GCloud credential
# 2. run ./annotate.sh URL
# 3. Get back Vision API tags
#
####################################################