Skip to content

Instantly share code, notes, and snippets.

View abeisgoat's full-sized avatar

Abe Haskins abeisgoat

View GitHub Profile
@abeisgoat
abeisgoat / example.html
Last active September 7, 2024 15:55
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 / 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: {},
};
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.",
{"names": [
"A Nova",
"Abbasak",
"Aberdeen",
"Abner Cay",
"Abruka",
"Absecon",
"Abu Musa",
"Acheron",
"Achill",
<!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 = {
@abeisgoat
abeisgoat / ImageUpload.js
Last active January 30, 2020 15:54
An example of image uploading using Firebase with AngularFire.
angular.module('app')
.controller('ImageUpload', ['$scope', '$log',
function ImageUpload($scope, $log) {
$scope.upload_image = function (image) {
if (!image.valid) return;
var imagesRef, safename, imageUpload;
image.isUploading = true;
imageUpload = {
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());
@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"