Skip to content

Instantly share code, notes, and snippets.

View iturgeon's full-sized avatar
The answer is always YES

Ian Turgeon iturgeon

The answer is always YES
View GitHub Profile
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) {
iturgeon /
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 / 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(}))
iturgeon / build.xml
Created July 17, 2018 23:58
Flex mxml ant build script including working framework RSLs
<?xml version="1.0"?>
<!-- FROM -->
<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 /
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 ( 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 domain for your distribution under the AWS cloudfront general tab
  2. nslookup
  3. Pick any of the ip addresses that domain resolves to (there will be several), lets assume was one
  4. Edit your /etc/hosts file and add a new line like :
iturgeon /
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 /
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:

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

Sending a post message to Canvas

const message = {
	subject: 'lti.frameResize',
iturgeon / Canvas LTI
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 / gist:b558ca84907e7dfc42ff42e57a3aff73
Last active January 18, 2024 11:43
Taboola blocking hosts file domains
# Block Taboola ads
iturgeon /
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 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