├── .eslintrc.json ├── .github └── workflows │ └── lint.yml ├── .gitignore ├── .prettierignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── SECURITY.md ├── bun.lock ├── next-env.d.ts ├── next.config.mjs ├── package.json ├── postcss.config.js ├── prettier.config.js ├── public ├── album.png ├── alistair.jpeg ├── favicon.ico ├── grain.jpeg └── videos │ └── mochip-educake.mp4 ├── src ├── blog │ ├── 2022 │ │ ├── 01 │ │ │ ├── mochip │ │ │ │ ├── email-from-colin.png │ │ │ │ ├── gmeet.png │ │ │ │ ├── goodbye-mochip.png │ │ │ │ ├── hegarty-time-exploit-old.webp │ │ │ │ ├── hegarty-time-exploit.jpeg │ │ │ │ ├── landing.jpeg │ │ │ │ └── mochip.tsx │ │ │ ├── serverless-discord-oauth │ │ │ │ ├── discord-oauth-dashboard.png │ │ │ │ └── serverless-discord-oauth.tsx │ │ │ └── zero-kb-blog │ │ │ │ └── zero-kb-blog.tsx │ │ ├── 03 │ │ │ └── open-source │ │ │ │ └── open-source.tsx │ │ └── 08 │ │ │ └── strict-tsconfig │ │ │ └── strict-tsconfig.tsx │ ├── 2023 │ │ └── wtf-esm │ │ │ └── wtf-esm.tsx │ ├── 2025 │ │ └── ambient-declarations │ │ │ └── ambient-declarations.tsx │ ├── Post.ts │ └── posts.ts ├── components │ ├── blog-footer.tsx │ ├── blog-post-list.tsx │ ├── external-link.tsx │ ├── message.tsx │ ├── note.tsx │ ├── stats.tsx │ └── syntax-highligher.tsx ├── fonts │ ├── gambarino-regular.ttf │ └── roobert-variable.woff2 ├── globals.css ├── hooks │ ├── layout.ts │ ├── use-did-initial-page-animations.ts │ ├── use-first-ever-load.ts │ ├── use-isomorphic-value.ts │ └── use-lerp-transform.ts ├── images │ ├── banner.jpg │ ├── matrix.gif │ └── me.jpg ├── pages │ ├── 404.tsx │ ├── [slug].tsx │ ├── _app.tsx │ ├── _document.tsx │ ├── _error.tsx │ ├── api │ │ ├── contact.ts │ │ ├── map.ts │ │ ├── oauth.ts │ │ ├── oauth │ │ │ └── [platform] │ │ │ │ ├── callback.ts │ │ │ │ └── redirect.ts │ │ ├── og.tsx │ │ ├── ping.ts │ │ └── posts.ts │ ├── blog.tsx │ ├── demos │ │ └── serverless-discord-oauth.tsx │ ├── experiments │ │ ├── index.tsx │ │ ├── morphing-shapes.tsx │ │ └── rekordbox-history-parser.tsx │ ├── index.tsx │ ├── monzo │ │ └── dashboard │ │ │ └── index.tsx │ └── stats.tsx ├── server │ ├── api.ts │ ├── apple-maps.ts │ ├── env.ts │ ├── monzo.ts │ └── sessions.ts └── utils │ ├── constants.ts │ ├── discord.ts │ ├── lists.ts │ ├── timers.ts │ └── types.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"], 3 | "rules": { 4 | "react/no-unescaped-entities": "off", 5 | "@next/next/no-img-element": "off", 6 | "@typescript-eslint/no-namespace": "off" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: 'lint' 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | 9 | jobs: 10 | build: 11 | name: 'Lint' 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Begin CI... 16 | uses: actions/checkout@v2 17 | 18 | - uses: oven-sh/setup-bun@v1 19 | with: 20 | bun-version: latest 21 | 22 | - name: Install dependencies 23 | run: bun install 24 | env: 25 | CI: true 26 | 27 | - name: Lint 28 | run: bun lint 29 | env: 30 | CI: true 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.pnp 3 | .pnp.js 4 | /build 5 | .DS_Store 6 | .env 7 | .env.local 8 | .env.development.local 9 | .env.test.local 10 | .env.production.local 11 | *.log 12 | .vercel 13 | .idea 14 | .eslintcache 15 | .next 16 | out 17 | 18 | # Yarn 19 | .yarn/* 20 | !.yarn/releases 21 | !.yarn/plugins 22 | !.yarn/sdks 23 | !.yarn/versions 24 | 25 | # bun 26 | *.bun 27 | 28 | # Cloud9 IDE files 29 | .c9 30 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | dist 3 | build 4 | out 5 | node_modules 6 | .yarn 7 | .git 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "typescript.enablePromptUseWorkspaceTsdk": true 4 | } 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 🦄 alii/website 2 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Don't use this and expect it to be totally secure, but on that note, it's just a React app. 4 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. 6 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | import { config as dotenv } from 'dotenv'; 2 | 3 | // @ts-check 4 | 5 | /** @type {import("next").NextConfig} */ 6 | const config = { 7 | env: dotenv().parsed, 8 | 9 | images: { 10 | remotePatterns: [ 11 | { 12 | protocol: 'https', 13 | hostname: 'i.scdn.co', 14 | pathname: '/image/*', 15 | }, 16 | 17 | { 18 | protocol: 'https', 19 | hostname: 'snapshot.apple-mapkit.com', 20 | pathname: '/api/v1/snapshot', 21 | }, 22 | ], 23 | }, 24 | 25 | async redirects() { 26 | return [ 27 | { 28 | source: '/outro', 29 | destination: 'https://www.youtube.com/watch?v=HeF11Av9WuU', 30 | permanent: true, 31 | }, 32 | { 33 | source: '/desu', 34 | destination: 'https://www.youtube.com/watch?v=HotGxCSas6A', 35 | permanent: true, 36 | }, 37 | { 38 | source: '/10', 39 | destination: 'https://youtu.be/G5HcvgepK-I', 40 | permanent: true, 41 | }, 42 | { 43 | source: '/lulzsec', 44 | destination: 'https://www.youtube.com/watch?v=DurOYPdXyF4', 45 | permanent: true, 46 | }, 47 | { 48 | source: '/wheels', 49 | destination: 'https://www.youtube.com/watch?v=9xRFN2i1cwQ', 50 | permanent: true, 51 | }, 52 | { 53 | source: '/letterone', 54 | destination: 'https://hyperfollow.com/alistair6/letter100-3', 55 | permanent: true, 56 | }, 57 | { 58 | source: '/live-25-01-2024', 59 | destination: 'https://www.youtube.com/watch?v=OvTy9xYH7LA', 60 | permanent: true, 61 | }, 62 | { 63 | source: '/live-02-02-2024', 64 | destination: 'https://youtube.com/watch?v=zEoTeUEElZc', 65 | permanent: true, 66 | }, 67 | { 68 | source: '/live-04-07-2024', 69 | destination: 'https://youtube.com/watch?v=-XsKN44b7ho', 70 | permanent: true, 71 | }, 72 | ]; 73 | }, 74 | }; 75 | 76 | export default config; 77 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "website", 3 | "version": "1.0.0", 4 | "repository": "git@github.com:alii/website.git", 5 | "author": "Alistair Smith ", 6 | "license": "Apache-2.0", 7 | "private": true, 8 | "packageManager": "bun@1.0.0", 9 | "scripts": { 10 | "dev": "next dev", 11 | "build": "next build", 12 | "start": "next start", 13 | "lint": "next lint" 14 | }, 15 | "devDependencies": { 16 | "@tailwindcss/forms": "^0.5.10", 17 | "@tailwindcss/postcss": "^4.1.7", 18 | "@types/common-tags": "^1.8.4", 19 | "@types/cookie": "^1.0.0", 20 | "@types/jsonwebtoken": "^9.0.9", 21 | "@types/jwa": "^2.0.3", 22 | "@types/react": "^19.1.5", 23 | "@types/react-dom": "^19.1.5", 24 | "@types/react-syntax-highlighter": "^15.5.13", 25 | "@types/uuid": "^10.0.0", 26 | "discord-api-types": "^0.38.8", 27 | "eslint": "9.27.0", 28 | "eslint-config-next": "15.1.8", 29 | "postcss": "^8.5.3", 30 | "prettier": "^3.5.3", 31 | "prettier-plugin-tailwindcss": "^0.6.11", 32 | "sharp": "^0.34.2", 33 | "tailwindcss": "^4.1.7", 34 | "typescript": "^5.8.3" 35 | }, 36 | "dependencies": { 37 | "@altano/satori-fit-text": "^1.0.2", 38 | "@c-side/next": "^1.0.0", 39 | "@marsidev/react-turnstile": "^1.1.0", 40 | "@next/third-parties": "^15.1.8", 41 | "@otters/monzo": "^2.1.2", 42 | "@prequist/lanyard": "^1.1.0", 43 | "@tailwindcss/typography": "^0.5.16", 44 | "@vercel/og": "^0.6.8", 45 | "alistair": "^1.14.4", 46 | "axios": "^1.9.0", 47 | "bwitch": "^0.3.0", 48 | "clsx": "^2.1.1", 49 | "common-tags": "^1.8.2", 50 | "cookie": "^1.0.2", 51 | "dayjs": "^1.11.13", 52 | "dotenv": "^16.5.0", 53 | "envsafe": "^2.0.3", 54 | "framer-motion": "^12.12.2", 55 | "jsonwebtoken": "^9.0.2", 56 | "jwa": "^2.0.1", 57 | "next": "^15.1.8", 58 | "nextkit": "^3.4.3", 59 | "react": "^19.1.0", 60 | "react-dom": "^19.1.0", 61 | "react-hot-toast": "^2.5.2", 62 | "react-icons": "^5.5.0", 63 | "react-syntax-highlighter": "^15.6.1", 64 | "satori": "^0.13.1", 65 | "use-lanyard": "^1.7.0", 66 | "uuid": "^11.1.0", 67 | "zod": "^3.25.28" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | const alistair = require('alistair/prettier'); 2 | 3 | module.exports = { 4 | ...alistair, 5 | plugins: ['prettier-plugin-tailwindcss'], 6 | }; 7 | -------------------------------------------------------------------------------- /public/album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/public/album.png -------------------------------------------------------------------------------- /public/alistair.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/public/alistair.jpeg -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/public/favicon.ico -------------------------------------------------------------------------------- /public/grain.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/public/grain.jpeg -------------------------------------------------------------------------------- /public/videos/mochip-educake.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/public/videos/mochip-educake.mp4 -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/email-from-colin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/email-from-colin.png -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/gmeet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/gmeet.png -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/goodbye-mochip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/goodbye-mochip.png -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/hegarty-time-exploit-old.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/hegarty-time-exploit-old.webp -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/hegarty-time-exploit.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/hegarty-time-exploit.jpeg -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/landing.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alii/website/9e7e8f5aabf66a628dc36a7f083a1433ac764735/src/blog/2022/01/mochip/landing.jpeg -------------------------------------------------------------------------------- /src/blog/2022/01/mochip/mochip.tsx: -------------------------------------------------------------------------------- 1 | import {stripIndent} from 'common-tags'; 2 | import {Highlighter} from '../../../../components/syntax-highligher'; 3 | import {Post} from '../../../Post'; 4 | import emailFromColin from './email-from-colin.png'; 5 | import gmeet from './gmeet.png'; 6 | import goodbyeMochip from './goodbye-mochip.png'; 7 | import hegartyTimeExploit from './hegarty-time-exploit.jpeg'; 8 | import mochipLanding from './landing.jpeg'; 9 | 10 | export class Mochip extends Post { 11 | public name = 'Avoiding homework with code (and getting caught)'; 12 | public slug = 'mochip'; 13 | public date = new Date('6 Jan 2022'); 14 | public excerpt = 'The eventful tale of me getting fed up with my homework'; 15 | public hidden = false; 16 | public keywords = [ 17 | 'school', 18 | 'homework', 19 | 'clout', 20 | 'hegarty maths', 21 | 'educake', 22 | 'homework hack', 23 | 'maths homework', 24 | 'programming', 25 | ]; 26 | 27 | public render() { 28 | return ( 29 | <> 30 |

Avoiding homework with code (and getting caught)

31 | 32 |

33 | Back in 2020, my school used a few online learning platforms that allowed 34 | professors/teachers to assign homework to students. I, as a lazy developer, wanted to 35 | spend more time playing games and writing code, especially when everyone was spending 36 | their time at home because of lockdown. I started writing this post in January of 2022, 37 | but I put off publicizing it for a while. It has been long enough since this all happened, 38 | so please sit back and enjoy. 39 |

40 | 41 |

The back story

42 |

43 | Let's set the scene. 2018, my school introduces a new online homework platform for 44 | students. It's called HegartyMaths and it does a lot. It's fairly simple, teachers 45 | choose a topic to set for us as homework, with that we get a 10-15 minute 46 | tutorial/informational video on the subject (of which we have to write down notes whilst 47 | watching) and a shortish quiz to complete after finishing the video. It's a lot of work, 48 | especially the quiz, and in the worst cases can take up to an hour to complete one topic 49 | (bad). 50 |

51 |

52 | Mostly, software engineers are rather lazy individuals. We tell metal how to do stuff for 53 | us. Homework then, naturally, is an arduous task for a developer who is still at school. 54 | So, still 2018, a close friend of mine by the name of{' '} 55 | 56 | Scott Hiett 57 | {' '} 58 | and I decided to do something about the Hegarty situation. We started to reverse engineer 59 | the frontend app and eventually came up with a Tampermonkey userscript that would glitch 60 | the embedded YouTube player to say that we'd watched the video at least 1x. Crucially, our 61 | teachers could see how many times we'd watched the video, so being able to skip up to 20 62 | minutes of homework time was especially useful – and it was a lot of fun to build too. 63 |

64 |

65 | So we flexed it on our Snapchat stories and had our school friends message us to use it 66 | blah blah. We eventually figured out that we could also set it to be watched over 9999x 67 | times; every time we did that our accounts were reset by the Hegarty team. 68 |

69 |

The first email

70 |

71 | After this, we got in contact with our Math teacher in November of 2018 and got her to 72 | send an email to HegartyMaths informing them of our petty exploit and they got back to us 73 | very quickly.{' '} 74 | 75 | I don't have the original email anymore but I distinctly remember it saying something 76 | along the lines of "Stop trying to hack our platform and get back to doing your 77 | homework." 78 | {' '} 79 | Edit: While writing this, I was able to uncover the deleted email from a photo we had 80 | taken of it in 2020. See below{' '} 81 | (certain details redacted for obvious reasons): 82 |

83 | Hegarty Time Exploit Email 84 |

85 | This response excited us a bit, as they were now aware of us messing around with the site 86 | and they had no intention of fixing the minor vuln we had anyway, so we kept using it. We 87 | had tried to build a script to answer the questions for us, but it was too much work at 88 | the time (complex data structures, weird API responses, etc etc). 89 |

90 |

Educake

91 |

92 | For a while, students had access to another platform called Educake. Similar to 93 | HegartyMaths but targeting Biology, Chemistry and Physics. There was no video to watch at 94 | the beginning. We'd used it for a few years, in fact since I joined the school, but I'd 95 | never thought about reversing until all of this began. 96 |

97 |

98 | One common factor between Hegarty and Educake is that they immediately give you the 99 | correct answer if you got a question wrong. We took advantage of this and wrote a small 100 | node/mongo app & tampermonkey script to detect when a user was on a quiz page, answer 101 | every question with a random number, and then store the correct answer in mongodb. I don't 102 | have the original source but the TamperMonkey script was probably something like 103 | the following: 104 |

105 | 106 | {stripIndent` 107 | const guess = Math.random(); 108 | 109 | const result = await post('/api/answer', { 110 | body: { 111 | answer: guess, 112 | }, 113 | }); 114 | 115 | await post('http://localhost:8080/save', { 116 | body: { 117 | question_id: question.id, 118 | answer: result.success ? guess : result.correct_answer, 119 | }, 120 | }); 121 | 122 | // Go to next question and repeat code above 123 | nextQuestion(); 124 | `} 125 | 126 | 127 |

128 | As you can see, it was quite literally a loop through every question, saving the correct 129 | answer as we got it and moving on. Eventually I added a few more features to fetch from 130 | the database if we already had the right answer (meaning we don't answer{' '} 131 | Math.random every time) and also I added in support for multiple choice (so 132 | that we actually pick one of the possible answers rather than making it up – however I was 133 | surprised that the Educake backend would allow an answer that wasn't even in the possible 134 | choices). 135 |

136 | 137 |

138 | Now working on the project solo, I decided it would be time to build a nice UI for it all 139 | and bundle it all into a simple Tampermonkey script for both flexing rights on Snapchat 140 | (people constantly begging me to be able to use it was certainly ego fuel I hadn't 141 | experienced before) and also for myself to get out of homework I didn't want to do. 142 |

143 |

144 | The end result? A ~200 line codebase that scooped up all questions and answers on the site 145 | that could repeatedly get 100% on every single assignment and a 15mb mongo database. 146 |

147 | 148 |

149 | Below is a small video of what it all looked like. It also demonstrates a feature I added 150 | allowing for a "target percentage" — meaning users could get something other than 100% to 151 | look like more real/human score. Video was recorded on my Snapchat in November 2019. 152 |

153 | 154 |