Skip to content

Instantly share code, notes, and snippets.

View iturgeon's full-sized avatar

Ian Turgeon iturgeon

View GitHub Profile
@iturgeon
iturgeon / dispatch-close-now.js
Last active August 14, 2020 18:34
Jest Test Exercise - Unreachable internal variables
import Dispatcher from './dispatcher'
// scoped to this file, not accessable outside
// used in the real world to prevent sending a
// window close tracking api request twice
let closeNowTriggered = false
const dispatchCloseNow = () => {
if (!closeNowTriggered) {
Dispatcher.trigger('window:closeNow')
@iturgeon
iturgeon / notes.md
Created August 6, 2020 18:12
Instructure Canvas LTI Scores for complete / incomplete

LTI scores passed back to assignments that are implemented as commplete/incomplete need to return 100% to canvas to be counted as complete.

This isn't really inherent in the naming of complete / incomplete. It's also difficult to find information on it, so I made this note for myself in the future and anyone else that may run into it.

@iturgeon
iturgeon / checksum.js
Last active February 7, 2019 20:31
Node cli script to create checksums of a file
#!/usr/bin/env node
// output a file checksum using crypto
// Ex call: ./checksum.js md5 package.json
const hash = require('crypto').createHash(process.argv[2]).setEncoding('hex')
require('fs').createReadStream(process.argv[3]).pipe(hash.on('finish',() => {console.log(hash.read())}))
@iturgeon
iturgeon / build.xml
Created July 17, 2018 23:58
Flex mxml ant build script including working framework RSLs
<?xml version="1.0"?>
<!-- FROM http://soenkerohde.com/2008/04/using-the-flash-player-cache-for-the-flex-framework/ http://soenkerohde.com/flex/build.xml -->
<project name="AntExample" default="build" basedir=".">
<!-- property has to be name FLEX_HOME to work with Flex Ant Tasks -->
<property name="FLEX_HOME" value="D:/tools/moxie/sdks/3.0.0" />
<!-- this is default and redundant but you could switch to a custom flex-config.xml -->
<property name="flex.config" value="${FLEX_HOME}/frameworks/flex-config.xml" />
@iturgeon
iturgeon / steps.md
Created January 30, 2018 18:33
Testing Cloudfront settings before changing dns

Need to test an aws cloudfront distribution before you change the DNS?

Let's imagine I'll be moving a domain (static.stuff.com) to cloudfront. I want to make sure that cloudfront is configured correctly before moving the dns for everyone. You can glue together a simple test with a couple commands locally

  1. locate the cloudfront.net domain for your distribution under the AWS cloudfront general tab
  2. nslookup xxxxxxxxx.cloudfront.net
  3. Pick any of the ip addresses that domain resolves to (there will be several), lets assume 10.10.10.10 was one
  4. Edit your /etc/hosts file and add a new line like : 10.10.10.10 static.stuff.com
@iturgeon
iturgeon / udoit.sh
Created November 16, 2017 23:56
Udoit init.d script
#! /bin/sh
# Installation
# 1. Move this script to /etc/init.d/udoitworker
# 2. chmod +x /etc/init.d/udoitworker
# 3. set DAEMON - full path to php executable (hint: `which php`)
# 4. set DAEMON_OPTS - full path to the worker php script and any options you desire
#
# Run on boot
# - openRC: `rc-update add udoitworker default`
# - ubuntu: `update-rc.d udoitworker defaults && update-rc.d udotiworker enable`
@iturgeon
iturgeon / examples.md
Last active January 7, 2021 21:14
Instructure Canvas PostMessage messages

Canvas iFrame PostMessages

Here's the controls you have inside an iframe in Canvas based on the code here: https://github.com/instructure/canvas-lms/blob/master/public/javascripts/lti/messages.js#L74-L170

Updated w/ help from https://github.com/bagofarms after he realized my original information was incorrect. He found some readme docs from Bracken on the subject which opened things up: https://github.com/bracken/lti_messaging

Sending a post message to Canvas

const message = {
	subject: 'lti.frameResize',
@iturgeon
iturgeon / Canvas LTI Passback.md
Last active December 6, 2019 17:56
How Instructure Canvas assignment dates affect LTI assignments and grade passback

How Canvas assignment dates affect LTI assignmetns and grade passback

The following were testing using replace result with a percentage value on Instructor's Canvas as of Nov 1 2018

Scenario One

  • No availibility dates set
  • Student launches assignment before due date
  • Score of 100% is sent back before due date
@iturgeon
iturgeon / gist:b558ca84907e7dfc42ff42e57a3aff73
Last active January 18, 2024 11:43
Taboola blocking hosts file domains
# Block Taboola ads
127.0.0.1 popup.taboola.com
127.0.0.1 www.popup.taboola.com
127.0.0.1 taboola.com
127.0.0.1 www.taboola.com
127.0.0.1 cdn.taboolasyndication.com
127.0.0.1 taboolasyndication.com
127.0.0.1 www.taboolasyndication.com
127.0.0.1 www.cdn.taboolasyndication.com
127.0.0.1 trc.taboola.com
@iturgeon
iturgeon / Recommendations.md
Last active May 25, 2017 17:57
Recommended git settings

Best Practices for Configuring Git CLI

  1. Use your actual name. Your git history is valuable evidince of your skills and experience.
  2. Use an email address that'll last. You may not be that proud of 1337SquirtleSquad@yahoo.com in a few years.
  3. If you don't know how to quit vi, change your default git editor
  4. Create a global gitignore to make sure you don't commit needless, massive, or dangerous files to any repo.
  5. Set colors (color.ui) to auto if possible. Git will automatically remove color info when piping into another output

Global Git Config