Skip to content

Instantly share code, notes, and snippets.

🎯 AI Prompt: Audience Persona Generation

Use this prompt after you've already created a Business Overview for your product or company. This helps the AI understand your audience on a deeper level, so future marketing, content, and sales prompts are more targeted and effective.


🧠 Prompt:

Based on the business overview you already have, generate 2–3 detailed audience personas for my product.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pay Here</title>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
</head>
<body class="font-sans">
<header class="bg-white shadow-sm">
@phawk
phawk / module-loading.js
Last active February 11, 2024 22:57
Defining AMD modules / libraries as AMD, Common JS and browser globals This is a quick way of defining a JS module that will load in any of three environments and allow you to pass in dependencies.
(function (global, $, name, definition) {
// Checks what environment we are in and loads accordingly
if (typeof define === "function" && define.amd) {
// With AMD we require the module with its name rather than passing the variable directly
define(["jquery"], definition); // AMD
}
else if (typeof module !== "undefined" && module.exports) {
// CommonJS will need to require the node module for jQuery
$ = require("jquery");
module.exports = definition($); // CommonJS
@phawk
phawk / .screenrc
Last active November 8, 2021 01:49
Sample screenrc
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
defscrollback 5000
@phawk
phawk / graphql.js
Created August 23, 2019 17:01
Lambda Shopify graphql proxy endpoint
const https = require("https")
const fetch = require("isomorphic-fetch")
const Account = require("./models/account")
const authenticated = require("./lib/auth")
exports.handler = authenticated(async (event, context) => {
const { id: shopId, shopifyToken } = context.account
try {
const resp = await fetch(`https://${shopId}/admin/api/2019-07/graphql.json`, {
@phawk
phawk / NSImage+QuickLook.swift
Created February 15, 2018 20:14
Swift macOS generate image previews of files on disk
import AppKit
import QuickLook
extension NSImage {
static func previewForFile(path fileURL: URL, ofSize size: CGSize, asIcon: Bool) -> NSImage? {
let dict = [
kQLThumbnailOptionIconModeKey: NSNumber(booleanLiteral: asIcon)
] as CFDictionary
@phawk
phawk / getToken.js
Created August 23, 2019 16:19
Shopify exchange OAuth code for token and create user account
const crypto = require("crypto")
const querystring = require("querystring")
const fetch = require("isomorphic-fetch")
const Account = require("./models/account")
exports.handler = async (event, context) => {
const { shop, hmac, code, timestamp } = event.queryStringParameters
const apiKey = process.env.SHOPIFY_API_KEY
const apiSecret = process.env.SHOPIFY_API_SECRET
@phawk
phawk / install.js
Created August 23, 2019 16:17
Shopify install lambda
exports.handler = async (event, context) => {
const shop = event.queryStringParameters.shop
const redirectUri = event.queryStringParameters.redirect
const apiKey = process.env.SHOPIFY_API_KEY
const scopes="read_content,write_content,read_products,read_themes,write_themes"
if (shop) {
const installUrl = 'https://' + shop +
'/admin/oauth/authorize?client_id=' + apiKey +
'&scope=' + scopes +
@phawk
phawk / payhere_embed_sdk.html
Last active December 29, 2020 08:00
Payhere embed SDK example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Embed Test Site</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.container {
margin: 4rem auto;
@phawk
phawk / authentication.js
Created August 23, 2019 16:53
Lambda HoC for authenticating requests with dynamoDB
const Account = require("../models/account")
module.exports = (handler) => async (event, context) => {
let auth = event.headers.authorization
auth = auth.replace(/^Basic\s/, "")
auth = Buffer.from(auth, 'base64').toString()
const [id, token] = auth.split(":")
const account = await Account.get({ id })