Skip to content

Instantly share code, notes, and snippets.

View tschwaerzl's full-sized avatar
🍕
is power

Thomas tschwaerzl

🍕
is power
  • Karlsruhe, Germany, EU
  • 14:38 (UTC +02:00)
View GitHub Profile
@tschwaerzl
tschwaerzl / delete_branch_directories.py
Created February 2, 2018 10:06
Delete all branch-directories on repository server which are non-existent in corresponding GitLab project
import os
import shutil
import requests
GITLAB_URL = 'https://foo.com/api/v4/projects/210/repository/branches'
GITLAB_TOKEN = '123456abcdefg' # GitLab user token
SERVER_PATH = '/apps/foobar/ios/development' # Where are the build branches
def remove_folder(path):
# check if folder exists
setInterval(function(){
var divs = document.getElementsByTagName('div')
var arr = Array.prototype.slice.call( divs)
var hearts = arr.filter(x => x.getAttribute('data-testid') == 'like')
hearts.forEach(h => h.click())
window.scrollTo(0, document.body.scrollHeight ||document.documentElement.scrollHeight);
},1000);
@tschwaerzl
tschwaerzl / build.yml
Created January 15, 2025 19:52
Cancel all old GitHub Actions runs that are stale after a new version of the Pull Request was uploaded
# GitHub Action Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Source: https://turso.tech/blog/simple-trick-to-save-environment-and-money-when-using-github-actions