Skip to content

Instantly share code, notes, and snippets.

View bbrala's full-sized avatar

Björn Brala bbrala

View GitHub Profile
@bbrala
bbrala / .gemrc
Last active May 9, 2018 06:08
How to run development version of vagrant on windows.
:ssl_verify_mode: 0
@bbrala
bbrala / two_branch_cleanup_scripts.sh
Created October 11, 2016 13:13 — forked from Emuentes/two_branch_cleanup_scripts.sh
SCRIPT-ONE: will print the names of the branches that have been merged into develop AND master in green. Also, branches that are only merged into develop but not master are listed in red. ---- SCRIPT-TWO: will delete the fully merged branches, those listed in green when you run SCRIPT-ONE
#######################################
# SCRIPT 1 - PREVIEW BRANCH DELETIONS #
#######################################
# will print the names of the branches that have been merged into develop and master in green and branches that are only merged into develop but not master in red.
BRANCHES_IN_MASTER=`git branch -r --merged origin/master | grep -v -E '(\*|master$|develop$)' | cut -f2- -d '/' | tr '\n' ';'` && export BRANCHES_IN_MASTER && git branch -r --merged origin/develop | grep -v -E '(\*|master$|develop$)' | cut -f2- -d '/' | xargs -L1 bash -c 'if [ $(grep -o "$0" <<< "$BRANCHES_IN_MASTER" | wc -l) -gt 0 ] ; then printf "\e[0;32m $0 \e[0m\n"; else printf "\e[0;31m $0 is merged into DEVELOP but not MASTER \e[0m\n"; fi';
#################################################################################################################################
# SCRIPT 2 - DANGER -- RUN AT YOUR OWN RISK -- The following script will DELETE the branches listed in the above preview script #
###########################
@bbrala
bbrala / gist:1866ad499a08aecaf1be67b1c3150574
Created January 27, 2017 12:18
rsyc backup using hardlinks
#!/bin/sh
#
# Based on http://www.noah.org/engineering/src/shell/rsync_backup
# Retention count 21 for making 3 backups each day for a week.
#
# This maintains a rotating backup. This will normalize permissions on
# all files and directories on backups. It has happened that someone removed
# owner write permissions on some files, thus breaking the backup process. This
# prevents that from happening. All this permission changing it tedious, but it
# eliminates any doubts. I could have done this with "chmod -R +X", but I
0459860a8fa12412b77fd59b3923493c548b2e7091b114ea74ad317bafea36999e212749d6212f218c500aa6f683a7f42d9af9535cc2ca89041bed049e3c5c945a;darkownage
#!/usr/bin/env bash
VERSION=${1:-9.4.x}
cd /home/localcopy
sudo chmod 777 -R drupal-core
rm -rf drupal-core-${VERSION//./-}
mkdir drupal-core-${VERSION//./-}
cd drupal-core-${VERSION//./-}
git clone -b ${VERSION} [email protected]:project/drupal web
cd web
mogrify -resize 3840x2160\> *.png
mogrify -resize 3840x2160\> *.jpg
mogrify -resize 3840x2160\> *.jpeg
@bbrala
bbrala / gist:9e3d7cbd849a78408e075343bbb18c63
Created November 19, 2023 15:14
composer.extra.dev-files.json
{
"*/*": [
".cspell.json",
".codeclimate.yml",
".ddev/",
".editorconfig",
".eslintignore",
".eslintrc",
".eslintrc.*",
".gitattributes",
@bbrala
bbrala / clone-results.bat
Created December 9, 2023 14:07
Checkout project analysis results for comparison with PHPStorm diff commands
@echo off
git clone [email protected]:project/project_analysis -b results results_a
git clone [email protected]:project/project_analysis -b results results_b
git clone [email protected]:project/project_analysis -b results-d11 results_d11_a
git clone [email protected]:project/project_analysis -b results-d11 results_d11_b
cd results_a
git switch results
git pull
cd ..
@bbrala
bbrala / update-apps.js
Last active October 17, 2024 08:37
JAMF NOW - convert all apps to admin-managed (javascript)
async function updateLoop() {
const timer = ms => new Promise(res => setTimeout(res, ms));
document.querySelector('[data-test="device-nav-apps"]').click();
await timer(500);
let menuList = document.querySelectorAll('button.more-menu');
for (const menu of menuList) {
menu.click();
await timer(100);