Skip to content

Instantly share code, notes, and snippets.

View dsample's full-sized avatar

Duncan Sample dsample

View GitHub Profile
@dsample
dsample / Dockerfile
Last active May 8, 2019 15:41
Sonar Scanner as a Docker image
FROM openjdk:latest
RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - \
&& yum install -y curl unzip \
&& mkdir /sonar \
&& curl -sSL -o /scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492.zip \
&& unzip -qd /sonar/ /scanner.zip \
&& mv /sonar/*/* /sonar/ \
&& rm /scanner.zip \
&& yum erase -y unzip \
@dsample
dsample / 1-yubikey-oath-code.sh
Last active December 6, 2022 09:45
Mac OSX - Automator - Applescript to type in frontmost application
# Make sure the Yubikey CLI (ykman) is installed
# Replace 'FOO' below with a unique string within the name of one of your keys.
# You can get a list using `ykman oath list`
/usr/local/bin/ykman oath accounts code -s "FOO"
@dsample
dsample / download-classdojo-media.js
Created July 18, 2021 08:59 — forked from travishorn/download-classdojo-media.md
Saving the images and videos from your ClassDojo storyline
/* run this in the console on the ClassDojo page */
function download(url) {
fetch(url).then(function (t) {
return t.blob().then((b) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(b);
var n = url.lastIndexOf("/");
var filename = url.substring(n + 1);
a.setAttribute("download", filename);
@dsample
dsample / download_class_dojo_archive.py
Created July 18, 2021 08:59 — forked from dedy-purwanto/download_class_dojo_archive.py
Download all photos and videos from your Class Dojo account
"""
Download all ClassDojo photos and videos in your timeline.
by kecebongsoft
How it works:
1. Fetch list of items in the timeline, if there are multiple pages, it will fetch for all pages.
2. Collect list of URLs for the attachment for each item
3. Download the files into local temporary directory, and also save the timeline activity as a json file.