Skip to content

Instantly share code, notes, and snippets.

View polluterofminds's full-sized avatar

Justin Hunter polluterofminds

View GitHub Profile
@polluterofminds
polluterofminds / AppContainer.js
Created October 27, 2022 16:15
Appjections App Container
import React from 'react'
import TopNav from "./TopNav";
import Inbox from "./Inbox";
const AppContainer = () => {
return (
<div>
<TopNav />
<Inbox />
</div>
@polluterofminds
polluterofminds / Email.js
Last active October 28, 2022 13:59
Appjections Email
import React, { useState } from "react";
const Email = ({ email, emails, loadEmails }) => {
const [showFullEmail, setShowFullEmail] = useState(false);
const replaceWithBr = () => {
return email.text.replace(/\n/g, "<br />");
};
const toggleEmail = () => {
@polluterofminds
polluterofminds / Inbox.js
Created October 27, 2022 15:56
Appjections Inbox
import React, { useEffect, useState } from "react";
import Email from "./Email";
import axios from "axios";
const Inbox = () => {
const [emails, setEmails] = useState([]);
const [unread, setUnreadCount] = useState(0);
const [loading, setLoading] = useState(false);
// Swipe pull down check code from https://stackoverflow.com/a/46248086
@polluterofminds
polluterofminds / TopNav.js
Created October 27, 2022 15:17
Appjections Top Nav
import React from "react";
const TopNav = () => {
return (
<div className="nav-flex-between">
<button>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
@polluterofminds
polluterofminds / InstallScreen.js
Last active October 28, 2022 13:59
Appjections Install Screen
import React from "react";
const InstallScreen = () => {
return (
<div className="flex-container">
<h1>Welcome to Appjections!</h1>
<h3>
Install the app and start experiencing the best app rejection emails
AI could ever write.
</h3>
@polluterofminds
polluterofminds / MobileView.js
Created October 26, 2022 15:49
Appjections Mobile View
import React, { useEffect, useState } from 'react'
import InstallScreen from "./InstallScreen";
import AppContainer from "./AppContainer";
const MobileView = () => {
const [standaloneMode, setStandaloneMode] = useState(false);
useEffect(() => {
let standalone = false;
if (window.matchMedia("(display-mode: standalone)").matches) {
standalone = true;
@polluterofminds
polluterofminds / DesktopView.js
Last active October 28, 2022 14:00
Appjections Desktop View
import React from "react";
const DesktopView = () => {
return (
<div className="flex-container">
<h1>Install Appjections today!</h1>
<p>
From any mobile device, visit this same page to install and experience
Appjections. Don't let your app rejection emails wait any longer.
Install today and feel the pain of not getting you app approved.
@polluterofminds
polluterofminds / App.js
Created October 26, 2022 15:39
App.js for progressive web app
import React, { useEffect, useState } from "react";
import "./App.css";
import MobileView from "./components/MobileView";
import DesktopView from "./components/DesktopView";
function App() {
const [mobile, setMobile] = useState(true);
useEffect(() => {
const isMobile = () =>
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
@polluterofminds
polluterofminds / email-rejections.js
Last active October 28, 2022 14:00
Email Rejections API
require("dotenv");
const axios = require("axios");
exports.handler = async (event, context) => {
try {
const totalEmailsToFetch = Math.floor(Math.random() * 3) + 1
const data = JSON.stringify({
model: "text-davinci-002",
prompt: "Write a funny email rejection from a mobile App Marketplace that gives a silly reason for the app's rejection.",
temperature: 0.7,
@polluterofminds
polluterofminds / index.html
Last active October 21, 2022 19:28
Twitter Instant Game index.html with body start
<style type="text/css">
body {
max-width: 85%;
margin: auto;
}
iframe {
width: 100%;
height: 100vh;
}
#locked {