Skip to content

Instantly share code, notes, and snippets.

View jonespm's full-sized avatar
🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"

Code Hugger (Matthew Jones) jonespm

🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"
View GitHub Profile
@onemenzel
onemenzel / lti_dyn_reg_py.md
Last active November 13, 2024 09:21
Django + pylti1p3 dynamic registration

LTI Dynamic Registration

This LTI dynamic registration implementation follows this guide: https://moodlelti.theedtech.dev/dynreg/

It allows you to create a one-off registration link, which you can use to register your Django application at a tool consumer, using the pylti1p3 package.

If you use this code, please refer to the guide / spec to see which fields to include in the JSONs that are being exchanged with the consumer. This implementation has only been tested with Moodle.

License

@krisleech
krisleech / renew-gpgkey.md
Last active April 21, 2025 11:05
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@ivan-pinatti
ivan-pinatti / jenkins-set-url-and-email.groovy
Last active September 22, 2023 20:20
Jenkins - Set URL and email via groovy script - #jenkins #groovy
#!groovy
// imports
import jenkins.model.Jenkins
import jenkins.model.JenkinsLocationConfiguration
// parameters
def jenkinsParameters = [
email: 'Jenkins Admin <[email protected]>',
url: 'https://ci.jenkins.com:8083/'
@obskyr
obskyr / stream_response.py
Last active January 1, 2025 14:46
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@n-st
n-st / .bash_profile
Created May 29, 2016 12:04
Start zsh from bashrc. Useful when you can't use chsh or when the same LDAP account is used both on systems with zsh installed and ones without.
# .bash_profile is executed for login shells,
# .bashrc is executed for interactive non-login shells.
# We want the same behaviour for both, so we source .bashrc from .bash_profile.
# Also, when .bash_profile exists, bash ignores .profile, so we have to source
# it explicitly.
if [ -f "$HOME/.profile" ]; then
. "$HOME/.profile"
fi