Skip to content

Instantly share code, notes, and snippets.

View phdd's full-sized avatar

Peter phdd

View GitHub Profile
@phdd
phdd / README.md
Last active April 30, 2018 07:50
Google Calendar recurring Event hack

Google Calendar recurring events hack

There seems to be a synchronization issue on some Android devices. Any calendar app renders recurring events a couple hundred times. Pretty annoying, cause it gets slow as hell and my smartwatch constantly chokes on all the notifications. This little Python script transforms all recurring events within a two-year timespan to single event instances. Thus, it's hacky but it solves the issue.

Install

@phdd
phdd / tasks.sql
Last active April 23, 2020 07:16
From planner-todo.web.app to todo.txt
select (case i.checked when 1 then 'x ' else '' end) || i.content
|| (case i.note when '' then '' else '\n' || replace(i.note, '
', '\n') end) || ' +' || replace(p.name, ' ', '')
|| (case when i.due_date != '' then ' due:' || substr(i.due_date, 0, 11) else '' end)
from Items as i
join Projects as p on i.project_id = p.id;
@phdd
phdd / toggl_to_hamster.py
Last active February 10, 2021 12:35 — forked from meunomemauricio/toggl_to_hamster.py
Script to Import a CSV file exported from Toggl.com to a Hamster DB
#! /usr/bin/python
"""Import CSV Files from Toggl to a Hamster DB."""
import argparse
import codecs
import csv
import sys
from datetime import datetime
@phdd
phdd / miniconda.plugin.zsh
Created March 24, 2022 08:36
ZSH Plugin for Lazy Loading Miniconda (Arch Linux) adopted from https://reddit.com/qmd25q
load_miniconda() {
unalias conda
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
@phdd
phdd / vscode-profiles.plugin.zsh
Created March 24, 2022 09:16
ZSH Plugin - Visual Studio Code Profiles
VSCODE_BIN=`which code`
code_with_profile() {
while true; do
case "$1" in
-p|--profile)
PROFILE_NAME="$2"
shift 2
;;
--)
@phdd
phdd / BodyParser.php
Last active January 26, 2024 09:32
UD Media Mautic Bounce rule
<?php
namespace Mautic\EmailBundle\MonitoredEmail\Processor\Bounce;
use Mautic\EmailBundle\MonitoredEmail\Exception\BounceNotFound;
use Mautic\EmailBundle\MonitoredEmail\Message;
use Mautic\EmailBundle\MonitoredEmail\Processor\Bounce\Definition\Category;
use Mautic\EmailBundle\MonitoredEmail\Processor\Bounce\Definition\Type;
use Mautic\EmailBundle\MonitoredEmail\Processor\Bounce\Mapper\CategoryMapper;