Skip to content

Instantly share code, notes, and snippets.

View westonkd's full-sized avatar

Weston Dransfield westonkd

View GitHub Profile
// Main function
function backupNotebooks() {
const urls = notebookUrlsFromInterval();
uploadNotebooks(urls)
}
/* Gmail Concerns */
const intervalDays = 1
const threadFilter = `from:do-not-reply@amazon.com "kindle" newer_than:${intervalDays}d`
@westonkd
westonkd / id_token.json
Created September 15, 2020 01:55
Example ID Token (LTI 1.3)
{
"https://purl.imsglobal.org/spec/lti/claim/message_type": "LtiResourceLinkRequest",
"https://purl.imsglobal.org/spec/lti/claim/version": "1.3.0",
"https://purl.imsglobal.org/spec/lti/claim/resource_link": {
"id": "7f956bcc8f67cd076ae464862ce83596a1bb3293",
"description": null,
"title": null,
},
"aud": "170000000000559",
"https://purl.imsglobal.org/spec/lti/claim/deployment_id": "189:7f956bcc8f67cd076ae464862ce83596a1bb3293",
{"lastUpload":"2020-04-27T01:29:26.857Z","extensionVersion":"v3.4.3"}
@westonkd
westonkd / advantage_certification_configuration.json
Last active March 2, 2020 18:36
Canvas LTI configuration for IMS LTI Advantage certification
{
"title": "IMS LTI Advantage Certification",
"scopes": [
"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem",
"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly",
"https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly",
"https://purl.imsglobal.org/spec/lti-ags/scope/score",
"https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly",
"https://canvas.instructure.com/lti/public_jwk/scope/update",
"https://canvas.instructure.com/lti/data_services/scope/create",
@westonkd
westonkd / vague_domain_fixup.rb
Last active November 7, 2019 17:20
Update vague tool domains to a more specific domain (if it can be inferred)
class VagueDomainFixer
VAGUE_DOMAIN = 'instructure.com'.freeze
class << self
def run(plan: true)
# How many shards are there?
shard_count = Shard.count
# Which one are we on now?
shard_progress = -1
@westonkd
westonkd / hackweek.md
Last active September 18, 2019 14:27
Hackweek Ideas #hackweek
  • Varaible substitution enforcement. On the dev key create UI show all subs a tool will be requesting (don't allow an admin to toggle them on/off though, no other company I've seen does that when you install an app). The first time a user launches show them these items and ask for permission. Don't launch the tool if they don't agree.

  • All the LTI post message services and improvements we talked about \o/

  • Show user what info will be sent in launch the first time a tool is clicked on

@westonkd
westonkd / script.js
Created April 29, 2019 16:55
OAuth 2 #canvas_reference
function success(response) {
console.log(response)
}
$.ajax({
type: "POST",
url: '/login/oauth2/token',
data: {
grant_type: 'authorization_code',
client_id: '10000000000048',
@westonkd
westonkd / example.md
Created February 19, 2019 18:00
Live Event Insights #live_events

#Insights Example

fields @timestamp, @message
| sort @timestamp desc
| limit 20
| filter @message like "f1fe1a76-228a-4b95-a226-fe028b612b66"