Skip to content

Instantly share code, notes, and snippets.

View polluterofminds's full-sized avatar

Justin Hunter polluterofminds

View GitHub Profile
@polluterofminds
polluterofminds / AppNFT.sol
Created August 18, 2022 18:19
App NFT Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AppNFT is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter public versions;
mapping(uint256 => string) public builds;
@polluterofminds
polluterofminds / PinataPartyContract.cdc
Last active November 18, 2022 10:23
Full PinataPartyContract
pub contract PinataPartyContract {
pub resource NFT {
pub let id: UInt64
init(initID: UInt64) {
self.id = initID
}
}
pub resource interface NFTReceiver {
pub fun deposit(token: @NFT, metadata: {String : String})
@polluterofminds
polluterofminds / [...nextauth].js
Created April 5, 2022 13:59
Members Only Step Three
import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
import { getCsrfToken } from "next-auth/react"
import { SiweMessage } from "siwe"
export default async function auth(req, res) {
const providers = [
CredentialsProvider({
name: "Ethereum",
credentials: {
@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 / 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 / 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 / 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 / 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 / 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"