Skip to content

Instantly share code, notes, and snippets.

View arnlaugsson's full-sized avatar
🐢
Slowly but surely

Skúli Arnlaugsson arnlaugsson

🐢
Slowly but surely
View GitHub Profile
# SPDX-FileCopyrightText: <text> 2020 Tony DiCola, James DeVito,
# and 2020 Melissa LeBlanc-Williams, for Adafruit Industries </text>
# SPDX-License-Identifier: MIT
# This example is for use on (Linux) computers that are using CPython with
# Adafruit Blinka to support CircuitPython libraries. CircuitPython does
# not support PIL/pillow (python imaging library)!
@arnlaugsson
arnlaugsson / Third-Party-Cams-On-Teams-in-MacOS.md
Last active November 20, 2021 12:00
How to get EpoCam working on Teams

Make video conferencing equipment work with Teams on MacOS

EpoCam didn't want to connect to Microsoft Teams. So, we have to "unsign" the application. This also worked for Polycom conference room equipment.

Do the following:

  1. Shut down Teams.
  2. Open up a terminal (iTerm 2 is reccomended, but not needed)
  3. Run the following lines of commands.
@arnlaugsson
arnlaugsson / canvas-peer-review-participation-extraction.js
Created November 28, 2020 15:08
To extract Peer Review participation from Canvas, using the DevTools and a bit of javascript.
/*
To extract Peer Review participation from Canvas
0. Navigate to an assignment's peer review page
1. Open up your favorite DevTools (in Chrome for example).
2. Copy and past the following code snippet into the DevTools console.
3. Right click on the object in the console and click "Store as a global variable"
4. The output will show the variable name given (for example "temp1"), type into the console: "copy(temp1)" and paste the output into your favourite editor.
5. You will have to format the output to match CSV format, but then you can paste it into Excel for furhter processing.
@arnlaugsson
arnlaugsson / find-merged-prs.js
Last active December 13, 2018 17:41
Find matching PRs in console
Array.from(
new Set(
Array.prototype.slice.call(
document.getElementsByClassName("message")
).map(
(match) => match.getAttribute("title")
).filter(
(match) => /^Merge pull request #/.test(match)
)
)
set nocompatible " be iMproved, required
filetype off " required
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive' " Git (Gstatus and more)
Plugin 'git://git.wincent.com/command-t.git' " Auto complete
https://akiaj3h5ct4qayf2oqnq.s3.amazonaws.com/generated.pdf?Signature=VtbKzh82t6uUlAJE9r6Y2ybpPUQ%3D&Expires=1497534270&AWSAccessKeyId=AKIAJ3H5CT4QAYF2OQNQ
set nocompatible " be iMproved, required
filetype off " required
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive' " Git (Gstatus and more)
Plugin 'git://git.wincent.com/command-t.git' " Auto complete

This can be accomplished in many ways. One way would be to configure Job A to have a build step, that triggers Job B, and fetches variables in a document after Job B has finished. Then Job A can read those variables and use them in later steps.

There are several things to consider here though. First of all this requires Job B to finish before Job A can/should continue, so if you are thinking of parallel job execution this isn't ideal. Secondly, when dealing with env variables you will need a plugin to make variables available outside of the build step (exporting isn't enough), check out the EnvInject plugin. And thirdly, if job configuration is becoming complex, there probably is a better way of doing it. With Jenkinsfile and previously pipelining plugins, Job orchestration has improved a lot, and passing parameters around and such is much easier in this new, shiny world. That being said, here is an example of something that works like what you are asking about.

Job A

  1. As a build step, trigger Job B,

Install Oracle Java 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Install Gradle 3.1

[
{"model": "menu.ingredient", "pk": 1, "fields": {"name": "av\u00f3kad\u00f3", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 2, "fields": {"name": "basil", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 3, "fields": {"name": "eldpipar", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 4, "fields": {"name": "hnetus\u00f3sa", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 5, "fields": {"name": "jalapeno", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 6, "fields": {"name": "kj\u00faklingur", "vegan": false, "vegetarian": false}},
{"model": "menu.ingredient", "pk": 7, "fields": {"name": "mang\u00f3", "vegan": true, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 8, "fields": {"name": "mozzarella", "vegan": false, "vegetarian": true}},
{"model": "menu.ingredient", "pk": 9, "fields": {"name": "parmaskinka", "vegan": false, "vegetarian": false}},