Skip to content

Instantly share code, notes, and snippets.

View gist:7266123eafb79296bf4a81bc2acf6f0d
Index: lib/directeditor.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/directeditor.php (revision c49b4a2fb8609b30d09fc5914753b64c23cab41b)
+++ lib/directeditor.php (date 1578566744661)
@@ -244,7 +244,8 @@
$csp->addAllowedFrameDomain($documentServerUrl);
} else {
View README.md

To be called with:

git diff --text --word-diff=porcelain | awk -v red="$(tput setaf 1)" -v green="$(tput setaf 2)" -v reset="$(tput sgr0)" -f ~/.dotfiles/scripts/worddiff.awk
@juliushaertl
juliushaertl / gist:75578e1fe9a1e8fee10ffe2f770598bf
Created Mar 22, 2019
cleanup bundled js files from gitattributes
View gist:75578e1fe9a1e8fee10ffe2f770598bf
cat .gitattributes | grep binary | awk '/./{gsub(/^\//, "", $1); print $1 }' | xargs git checkout --
View gist:e05eb309afde43ab639c9d377f75e1b5
for i in `seq 1 100`; do wget https://picsum.photos/3000/2000/?random -O $i.jpg; done
@juliushaertl
juliushaertl / github-merge-report.py
Created Feb 3, 2018
github-merge-report for sending list of updated pull requests of the last day
View github-merge-report.py
from github import Github
from datetime import datetime, timedelta
date = datetime.today() - timedelta(days=1)
g = Github("username", "apikey")
query = "org:nextcloud type:pr is:merged base:master updated:>=%s" % date.strftime("%Y-%m-%d")
prs = g.search_issues(query, sort="updated", order="desc")
@juliushaertl
juliushaertl / google-location-history-to-gpx.md
Last active Aug 23, 2019
google-location-history-to-gpx
View google-location-history-to-gpx.md

convert google takeout archive for location history from kml to gpx and split file into one per day

gpsbabel -i kml -f Location\ History.kml -o gpx -F out.gpx
gpsbabel -t -i gpx -f out.gpx -x track,merge,pack,split,title="ACTIVE LOG # %Y%m%d" -o gpx -F split.gpx
python2 gpxsplitter.py split.gpx
@juliushaertl
juliushaertl / nextcloud-app-test-pr.md
Last active Oct 11, 2017
Testing a pull request for Nextcloud apps
View nextcloud-app-test-pr.md

If you have installed an app from the app store and want to help testing a pull request you can easily apply the changes by using the patch commandline tool.

Take the pull request URL, append .patch to it and download the file:

Example for PR: https://github.com/nextcloud/deck/pull/320

wget https://github.com/nextcloud/deck/pull/320.path

Apply the patch to your apps directory:

View nextcloud-registration-api-test.md

API documentation DRAFT

The OCS Registration API allows you to register for an account, check the status of the registration and get initial login credentials from within clients.

The base URL for all calls to the API is: <nextcloud_base_url>/ocs/v2.php/apps/registration/api/v1

If cloud providers implement that api they need to provide all of the endpoints described in the following.

All calls to OCS endpoints require the OCS-APIRequest header to be set to true.

View abfall2ics_wuerzburg.py
import json, requests
from icalendar import Calendar, Event, Alarm
from datetime import date, datetime, time, timedelta
from calendar import monthrange
from html.parser import HTMLParser
pars = HTMLParser()
addr = "19935"
year = 2018
@juliushaertl
juliushaertl / mysql_convert_mb4.sh
Created Oct 26, 2016
convert a mysql table to utf8mb4 (useful for migration to mb4 on Nextcloud)
View mysql_convert_mb4.sh
#!/bin/bash
#
# CHANGE VALUES OF DATABASE AND MYSQL TO MATCH YOUR SETUP
DATABASE="devncmaster"
MYSQL="mysql -N --database=$DATABASE"
# convert database with all tables to utf8mb4
echo "ALTER DATABASE $DATABASE CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin;" | $MYSQL
You can’t perform that action at this time.