Skip to content

Instantly share code, notes, and snippets.

@yjsoon
yjsoon / gist:4fbd9709ea40ddc3d992368aebed5098
Created October 29, 2023 21:48
Prompt for app development advice
You are a patient instructor with years of experience running a course for me and my teammates, high school students aged 13-18, to learn Swift and SwiftUI. As a final project, we will build an app to release on the App Store. Past students have come to you with ideas that are difficult to create, or won't pass approval, or just aren't very well thought out, and you've given good advice to get them back on track. I would like to chat with you about ideas for an app I want to create; you should answer in a socratic fashion and spark enquiry, but be definitive and firm where necessary.
Below are some parameters defining what apps you, as the instructor, would recommend and approve.
Don't make these apps unless you have a good reason:
• Apps that that won’t pass Apple’s App Store review
• Apps that are too large or complex, e.g. require multiple users to be useful, like a social network.; require a back-end server, like anything login-based, or streaming; involve e-commerce or even payments of any kind; are hi
@yjsoon
yjsoon / gist:742237d8b29fcf892529003ff11ebe57
Created October 29, 2023 21:27
Sample Generative AI prompt for app description
I'm working on an app to release on the App Store. Here are the details from my project journal:
• App Name: {App Name Here}
• Challenge Statement: {Challenge Statement Here}
• Essential Question: {Essential Question Here}
• Innovative Solution: {Your Solution Here}
• Existing Solutions: {Current Solutions Here}
• Target Audience: {Target Audience Here}
• Key Features of the App: {Key Features Here}
• Benefits for Users: {Benefits for Users Here}
@yjsoon
yjsoon / App.js
Created October 14, 2023 09:35 — forked from happyharis/App.js
PCMOB4 Notes Starter Code
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import React from "react";
import NotesScreenAdd from "./screens/NotesScreenAdd";
import NotesScreenHome from "./screens/NotesScreenHome";
const Stack = createStackNavigator();
export default function App() {
return (
@yjsoon
yjsoon / hidesidebar.js
Last active May 17, 2023 00:07
JS inject to hide ChatGPT sidebar, with button to toggle back
// should load after DOM, e.g. document.addEventListener('DOMContentLoaded', function() { }
const targetDiv = document.querySelector('div.dark.flex-shrink-0.overflow-x-hidden.bg-gray-900');
if (targetDiv) {
targetDiv.style.display = 'none';
const button = document.createElement("button")
button.innerHTML = "≡"
button.style.position = "absolute"
button.style.left = "10px"
import PlaygroundSupport
import SwiftUI
struct MyView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello world"/*@END_MENU_TOKEN@*/)
}
}
body {
font-family: Arial, Helvetica, sans-serif;
}
h1 {
font-style: italic;
color: blue;
font-size: 72px;
}
static func saveToFile(friends: [Friend]) {
let plistName = "friends"
let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
let archiveURL = documentsDirectory.appendingPathComponent(plistName).appendingPathExtension("plist")
let propertyListEncoder = PropertyListEncoder()
let encodedFriends = try? propertyListEncoder.encode(friends)
try? encodedFriends?.write(to: archiveURL, options: .noFileProtection)
from microbit import *
import random
answers = [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes, definitely",
"You may rely on it",
"As I see it, yes",
from microbit import *
while True:
if button_a.is_pressed():
display.show(Image.HAPPY)
elif button_b.is_pressed():
break
else:
display.show(Image.SAD)
from microbit import *
boat = Image("00550:"
"05050:"
"50050:"
"99999:"
"09990")
display.show(boat)