Skip to content

Instantly share code, notes, and snippets.

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

Ian Turgeon iturgeon

👻
The answer is YES
View GitHub Profile
@iturgeon
iturgeon / firefox_ssh_proxy.md
Last active January 23, 2017 15:07
Firefox - Proxy connections through SSH from another server

SSH as [email protected], creating a SOCKS proxy on port 8123

In Firefox, set a manual SOCKS v5 proxy config for localhost on port 8123

ssh -D 8123 -C -q -N [email protected] add -f if you want to background the process

@iturgeon
iturgeon / nthFromEnd.rb
Last active February 2, 2017 16:06
Find Nth from end of a linked list
class Node
attr_accessor :nextNode, :value
def initialize(value, nextNode = nil)
@value = value
@nextNode = nextNode
end
end
def nthFromEnd(startNode, n)
rabbit = turtle = startNode
@iturgeon
iturgeon / nthFromEnd.js
Created February 1, 2017 21:59
Nth item from the end of a list
"use strict";
let nthFromEnd = (startNode, n) => {
let rabbit = startNode;
let turtle = startNode;
while(n--){
rabbit=rabbit.nextNode;
}
while(rabbit){
rabbit=rabbit.nextNode;
@iturgeon
iturgeon / print_stairs.rb
Last active February 8, 2017 19:31
Whiteboard wednesday - print stairs
# n | 0 1 2 3 4 5
# i |____________
# 1 | _ _ _ _ _ #
# 2 | _ _ _ _ # #
# 3 | _ _ _ # # #
# 4 | _ _ # # # #
# 5 | _ # # # # #
# 6 | # # # # # #
@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 [email protected] 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

@iturgeon
iturgeon / gist:b558ca84907e7dfc42ff42e57a3aff73
Last active March 2, 2025 05:12
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 / 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 / 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 / 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 / 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