Skip to content

Instantly share code, notes, and snippets.

@hawkrives
Last active May 15, 2024 17:05
Show Gist options
  • Save hawkrives/4855616dbda70f7708839ac07cfcf246 to your computer and use it in GitHub Desktop.
Save hawkrives/4855616dbda70f7708839ac07cfcf246 to your computer and use it in GitHub Desktop.
test carbide
import {examine, expandStudent} from '@gobbldygook/core'
import yaml from 'js-yaml'
import {padStart} from 'lodash/padStart'
import * as school from '@gobbldygook/school-stolaf'
function find_details_subdir(clbid) {
let str_clbid = padStart(clbid, 10, '0')
let n_thousand = Math.floor(clbid / 1000)
let thousands_subdir = padStart(n_thousand * 1000, 5, '0')
return thousands_subdir + '/' + str_clbid
}
function loadCourse(clbid) { ///Load the course… by requesting it from github! :D
return fetch(`https://raw.githubusercontent.com/StoDevX/course-data/master/courses/${find_details_subdir(clbid)}.json`).then(r => r.json())
}
function loadArea({name, revision, type}) { ///This variant won't actually work for most people, but it'd do for a demo.
let url
if (name === 'Computer Science') {
url = 'https://raw.githubusercontent.com/hawkrives/gobbldygook-area-data/master/majors/computer-science.yaml'
}
else if (name === 'Asian Studies') {
url = 'https://raw.githubusercontent.com/hawkrives/gobbldygook-area-data/master/majors/asian-studies.yaml'
}
return fetch(url).then(r => r.text()).then(t => yaml.safeLoad(t))
}
function prettify(school, results) {
// make the results pretty
return JSON.stringify(results)
}
async function main(student_file) {
const student = {name: 'Hawken Rives'}
// We start with a basic student, and flesh it out with the referenced data
const loaded = await expandStudent(student, loadCourse, loadArea)
// Then we check it
const results = await examine(loaded)
// and finally we show the results
console.log(prettify(school, results))
}
@nemoj463
Copy link

Good afternoon. Every time I play at the Australian Shazam Casino, I get a lot of positive emotions and impressions. The casino website has a user-friendly and optimised interface that allows you to navigate through the sections and quickly find games for yourself. By the way, all the games that are presented on this casino are developed by leading providers that guarantee the quality of the game and high winnings.

@danzacuduro
Copy link

I found a great and easy way to make money. I bet on sports. By the way, this is a popular method in Azerbaijan, and many people earn money this way. It is only important to choose a reliable bookmaker. It's good that I found the bookmaker Mostbet https://mostbetaz.org/ оn the website you can read more about it. Here you will be able to bet on a variety of sporting events. And there is also a convenient mobile application. If you live in Azerbaijan and don't know where to bet on sports, then Mostbet is the perfect option for you, because here you will be able to enjoy betting on sports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment