Skip to content

Instantly share code, notes, and snippets.

View tertek's full-sized avatar

Ekin Tertemiz tertek

  • Swiss Tropical and Public Health Institute
  • Basel
View GitHub Profile
@tertek
tertek / pcov-code-coverage-windows.md
Last active August 18, 2022 09:22
PHPUnit Code-Coverage with PCOV on Windows (Local Development Environment)

PHPUnit Code-Coverage with PCOV on Windows

Download and Install PCOV

  1. Download latest release (currently 1.0.11) for Windows for your version of PHP and the correct format (ts or nts) from PECL
  2. Unzip downloaded package and copy the files php_pcov.dll and php_pcov.pdb to your PHP extensions directory, e.g. C:\bin\php\php-7.4.27-Win32-vc15-x64\ext\
  3. Modify your php.ini so that PCOV is loaded. Therefore add extension=pcov:
..
extension=fileinfo
extension=gd2
@tertek
tertek / redcap-testing.php
Last active August 19, 2022 10:39
REDCap Testing Helpers
<?php
function addRepeatingForm($projectId=null, $eventId=null, $form=null, $customLabel=null) {
// Prepare parameters
if($projectId === null) {
$projectId = PROJECT_ID;
}
if($eventId === null){
@tertek
tertek / squash_git_commits_after_push.md
Last active February 3, 2023 08:39
Squash git commits and push to remote

Squash <n-amount-of-last-commits> locally for <branch>

$ git rebase -i origin/<branch>~<n-amount-of-last-commits> <branch>

and then force push to remote <branch>

git push origin +

@tertek
tertek / remote-odk.py
Last active December 5, 2023 09:24
Test python remote code execution for zapier
def hello():
return "Hello World from Github"
test = hello()
output = [{'test-2': test}]
@tertek
tertek / initial_setup.sh
Created January 22, 2024 07:50
Initial Setup Script for a VPS running Linux Ubuntu
#!/bin/bash
set -euo pipefail
########################
### SCRIPT VARIABLES ###
########################
# Name of the user to create and grant sudo privileges
USERNAME=sammy