Skip to content

Instantly share code, notes, and snippets.

@mcserep
mcserep / canvas-rename.py
Last active February 15, 2023 13:55
Canvas LMS script to rename all downloaded submissions in a folder to the university identifier code of the students.
"""MIT License
Copyright (c) 2023 Mate Cserep, https://mcserep.web.elte.hu/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mcserep
mcserep / canvas-audit.py
Last active February 12, 2023 17:03
Canvas LMS script to automatically check the quiz audit logs and filter out students who interrupted the quiz too many times.
"""MIT License
Copyright (c) 2021-2022 Mate Cserep, https://mcserep.web.elte.hu/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mcserep
mcserep / clean_code.md
Created May 21, 2021 19:57 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mcserep
mcserep / simple-saml-auth.php
Created February 22, 2021 11:21
Minimalistic Wordpress authentication hook to use an external, Shibboleth based method to verify users via SimpleSAMLphp.
<?php
/**
* Plugin Name: Simple SAML Authenticator
* Plugin URI: https://gist.github.com/mcserep/d14f73b054bbb88c274c9568e35eba10
* Description: Defines an authentication hook to use an external, Shibboleth based method to verify users.
* Version: 1.0.0
* Author: Máté Cserép
* Author URI: http://codenet.hu/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@mcserep
mcserep / LdapAuthenticator.php
Last active May 13, 2023 22:10
An object-oriented, very simple LDAP authenticator in PHP, so you don't have to deal with the low level ldap_* functions.
<?php
/**
* MIT License
*
* Copyright (c) 2020 Máté Cserép, https://codenet.hu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@mcserep
mcserep / NeptunIdentity.php
Last active September 26, 2020 20:42
A Yii identity implementation which authenticates the user with the Neptun academic registry system through SimpleSAMLphp.
<?php
/* LICENSE
* Copyright (c) 2014 Máté Cserép
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it