Skip to content

Instantly share code, notes, and snippets.

@ChrLipp
ChrLipp / bmv.py
Last active February 18, 2020 08:45
Python script to fetch the BMV Abholtermine (https://www.bmv.at/service/muellabfuhrtermine.html). Target: include this in home assistant.
from urllib import request, parse
from bs4 import BeautifulSoup
from datetime import date, datetime
# Checks if the given string is a valid date in the future (or today).
def parse_date(date_string):
result: date = None
if ', ' in date_string:
parts = date_string.split(', ')
parsed_date = datetime.strptime(parts[1], '%d.%m.%Y').date()
@ChrLipp
ChrLipp / keybase.md
Last active September 5, 2016 12:30
keybase.md

Keybase proof

I hereby claim:

  • I am chrlipp on github.
  • I am chrlipp (https://keybase.io/chrlipp) on keybase.
  • I have a public key ASAZ-k_Z1mY8iiu0dca334ethXz5oZLbLr-SVuYffG3Lkgo

To claim this, I am signing this object:

'use strict';
var gulp = require('gulp'),
del = require('del'),
tslint = require('gulp-tslint'),
typescript = require('gulp-typescript'),
babel = require('gulp-babel'),
sourcemaps = require('gulp-sourcemaps'),
mocha = require('gulp-mocha'),
istanbul = require('gulp-istanbul'),
@ChrLipp
ChrLipp / GenerateHtmlCalendar.groovy
Last active November 4, 2015 16:43
Generate a HTML Year Calendar with Groovy
int monthToGenerate = 12
int dayToGenerate = 31
println '''\
<!DOCTYPE html>
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css" />
// Tried to provide a Groovy translation of this Scala code:
// See http://stackoverflow.com/questions/16115757/groovy-equivalent-to-scala-trait-stackable-modifications
import groovy.transform.ForceOverride
interface IntQueue {
Integer get()
void put(Integer x)
}
trait Incrementing implements IntQueue {
@ChrLipp
ChrLipp / Stack trace with Gradle 1.5
Last active December 19, 2015 00:29
Stack trace of compiling a Groovy *println 'Hello World'* with Gradle (version in the title). I have to note that this works almost most of the Time!
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> org/apache/ivy/core/report/ResolveReport
* Try:
Run with --info or --debug option to get more log output.