Skip to content

Instantly share code, notes, and snippets.

View stuartf's full-sized avatar

D. Stuart Freeman stuartf

  • Georgia Institute of Technology
  • Atlanta, GA, USA
View GitHub Profile
@stuartf
stuartf / did.js
Created July 8, 2020 14:38
Attempt to create long-form sidetree dids using element-lib
const element = require("@transmute/element-lib");
const db = new element.adapters.database.ElementRXDBAdapter({
name: "element-rxdb.element-app",
adapter: "memory",
});
const storage = new element.adapters.storage.StorageManager(
db,
element.storage.ipfs.configure({
BEGIN MESSAGE.
6aW57JLO11i6Mir YfnBW1KkFmSjMs3 oLOJCQqARiwcXVx SQwhJYaRE3cMP1G
csW9xj3seVMoZDC In7KWnn87wlTCKq 6Xr2MZHgg7CrbUm HjFDVhHyB6JxpOv
gn81w19QBSJG54W KM0JlrP5sN76WqL WmlrXRGHDgccIYF ZhkTniqSmx6BoL5
3R6vtZR6WPNycDE pr64fyoqquK9x7G BxgF02IP.
END MESSAGE.
<?php
// You'll need to use composer to install "symfony/browser-kit", "symfony/http-client" and "symfony/mime"
// Bring in the browserkit library
require_once( 'vendor/autoload.php' );
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
// Make the galaxy form call our upload function when it's completed
add_action( 'gform_after_submission', 'post_to_third_party', 10, 2 );
const BuzzApi = require('buzzapi');
const config = require('./config.json');
const buzzapi = new BuzzApi({'apiUser': config.buzzapi.appid, 'apiPassword': config.buzzapi.password, 'server': config.buzzapi.server});
const test = async function() {
try {
const result = await buzzapi.post('central.academics.course_catalog.course_info_summary', 'search', {term_code: 202005, crn: 80000});
console.log(result);
@stuartf
stuartf / bjj.puml
Created June 28, 2019 12:50
PlantUML BJJ MindMap
@startdot
digraph bjj {
node [style=rounded, shape=box]
standing [fillcolor=lightblue, style="filled", shape=triangle]
takedown
guardpull
reguard
fullguard [fillcolor=lightblue, style="filled", shape=triangle]
dlr [fillcolor=lightblue, style="filled", shape=triangle]
dlrx [fillcolor=lightblue, style="filled", shape=triangle]
@stuartf
stuartf / getPageViews.js
Created March 4, 2019 22:03
Get Canvas page views for a list of users between 2 dates by sis_user_id
const parse = require('csv-parse/lib/sync');
const fs = require('fs');
const Canvas = require('canvas-lms-api');
const config = require('../config.json');
const promiseRetryify = require('promise-retryify');
const canvas = new Canvas(config.canvas.url, {'accessToken': config.canvas.token});
canvas.qsStringifyOptions = { arrayFormat: 'repeat' };
[
{"link":"https://pe.gatech.edu/courses/georgia-tech-basic-economic-development-course","title":"Georgia Tech Basic Economic Development Course","description":"The Annual Basic Economic Development Course (BEDC) has been the first professional step for over 3,000 economic developers. This four-day conference encourages you to network with industry peers and experts, explore the fundamentals and emerging concepts of comprehensive economic development, and transform into an influential local leaders as you immediately implement tools and skills you gain.  Concepts taught in this course revolve around five major themes: innovative community development, regional economics, basic factors in development, techniques of economic development, and trends in economic development  ","id":"EDEV 1000P","format":"Classroom","instructor":[],"admin":"Leigh Hopkins, AICP"},
{"link":"https://pe.gatech.edu/courses/iedc-business-retention-and-expansion","title":"IEDC Business Retention and Expansion","description":"While attrac

Keybase proof

I hereby claim:

  • I am stuartf on github.
  • I am stuartf (https://keybase.io/stuartf) on keybase.
  • I have a public key whose fingerprint is 13C0 BEBC 9A6B DCA6 E8A1 BA94 EF88 D796 5234 0974

To claim this, I am signing this object:

@stuartf
stuartf / grabpre.js
Created September 29, 2016 16:21
Get everything from <pre> tags in an html file
var cheerio = require('cheerio');
var fs = require('fs');
fs.readFile(process.argv[2], function(err, html) {
var $ = cheerio.load(html);
console.log($('pre').html());
});
var fs = require('fs');
var readline = require('readline');
var log = [];
// Set up to read the log line by line
var rd = readline.createInterface({
input: fs.createReadStream('./gtx-edx-events-2016-07-11.log'),
output: process.stdout,
terminal: false