Skip to content

Instantly share code, notes, and snippets.

View jasonappah's full-sized avatar
:shipit:

Jason Antwi-Appah jasonappah

:shipit:
View GitHub Profile
@jasonappah
jasonappah / types.ts
Created February 27, 2023 21:35
Nebula Labs Degree API Types (TypeScript)
enum RequirementTypes {
collection = "collection",
course = "course",
section = "section",
major = "major",
minor = "minor",
exam = "exam",
gpa = "gpa",
hours = "hours",
consent = "consent",
@jasonappah
jasonappah / quizlet_anki.js
Last active December 15, 2022 21:02
Import Quizlet sets into Anki
// 12-15-2022 - lazy attempt at yeeting a quizlet deck into a format i can import into anki :)
// to use, copy this into your browser's console and run it.
// as soon as you run it, be sure to focus the tab so the copy to clipboard actually works
// then paste output into a text file and profit
setTimeout(() => navigator.clipboard.writeText(Array.from(document.getElementsByClassName("SetPageTerm-content")).reduce((acc, curr)=>{
const [qEl, aEl] = curr.children
acc += `${qEl.innerText}; "${aEl.innerHTML.replaceAll('"', '""')}"
`
return acc
@jasonappah
jasonappah / .prettierrc
Last active October 28, 2021 18:35
Prettier config I like to use on most of my repos
{
"printWidth": 90,
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "always",
"requirePragma": false,
@jasonappah
jasonappah / fgh.ts
Created May 21, 2021 15:57
An attempt at creating a @withfig autocompletion spec taking advantage of Cobra's dynamic completions feature.
// fgh __complete ""
export var completionSpec: Fig.Spec = {
name: "fgh",
description: "Automate the lifecycle and organization of your cloned GitHub repositories"
subcommands: getCmds('fgh complete ""'),
args: getCmds('fgh complete --')
}
@jasonappah
jasonappah / color.js
Last active August 25, 2020 01:53
Screenshot
// note to all who see this - i haven't tested this yet so I have no idea if it works yet
const puppeteer = require('puppeteer')
const browser = await puppeteer.launch();
const color = "#00ff00"
const width = 1920
const height = 1080
const page = await browser.newPage();
@jasonappah
jasonappah / log.js
Created July 10, 2020 19:57
Simple node.js script to test the Serial output of an Arduino.
// run 'npm i serialport terminal-overwrite' before running this!
const SerialPort = require('serialport')
const Readline = require('@serialport/parser-readline')
const terminalOverwrite = require('terminal-overwrite');
const BAUD_RATE=9600
const PORT="ENTERYOURPORTHERE"
const port = new SerialPort(PORT, { baudRate: BAUD_RATE })
@jasonappah
jasonappah / style.css
Last active July 1, 2020 04:28
CSS uploaded by scrapbook.hackclub.com/customizer
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap');
:root {
--background: linear-gradient(145deg, #198dd2, #1ea8f9);
}
#__next {
background-color: #1c9de9;
font-family: 'Lato', sans-serif;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonappah
jasonappah / isPalindrome.py
Last active June 25, 2020 02:17
Palindrome?
# This is a quick script I wrote to find if a string is a palindrome.
# I feel like there's probably a more efficient way of doing this, but it works. To my credit, I did this in about 45 minutes.
x = "20200202"
def isPalindrome(str=""):
if str=="":
return -1
elif str[::1] == str:
return True
@jasonappah
jasonappah / hey.py
Last active July 7, 2020 04:02
hey!
def hey(viewer):
if viewer.isCool == True:
print('Go to my scrapbook, powered by hackclub/summer-scrapbooks!')
print('https://scrapbook.jasonaa.me')
else:
viewer.isCool = True
hey(viewer)
# Be cool. https://scrapbook.jasonaa.me