Skip to content

Instantly share code, notes, and snippets.

View heinrichreimer's full-sized avatar

Jan Heinrich Reimer heinrichreimer

View GitHub Profile
@heinrichreimer
heinrichreimer / redirect.html
Last active March 30, 2017 02:00
Redirect to any other webpage. (JS required)
<script type="text/javascript">
<!--
window.location = "https://www.heinrichreimer.com/";
//–>
</script>
@heinrichreimer
heinrichreimer / hidden.css
Created September 24, 2013 14:06
Hide all elements with attribute "hidden"
[hidden]{
display:none;
}
function validate_url($url){
$result = preg_match("/^(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})(\/([\da-z\.-]+))*\/?(([\w\.-]+)\.([\da-z]{2,6}))?((\#[\w\.-]+)|(\?([\da-z]+(=[\da-z]+)?)(&([\da-z]+(=[\da-z]+)?))*))?/i", $url);
return $result;
}
/*Usage*/
if(validate_url("http://heinrich-reimer.de")){
/*Do something*/
}
@heinrichreimer
heinrichreimer / background_wallpaper_styles.xml
Created May 1, 2014 23:50
Use android wallpaper as activity background
<resources>
<style name="Configuration.Theme" parent="Configuration.Theme.Base">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">#1000</item>
</style>
</resources>
@heinrichreimer
heinrichreimer / SpanningGridLayoutManager.java
Last active March 11, 2024 08:26
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
package com.example;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningGridLayoutManager extends GridLayoutManager {
@heinrichreimer
heinrichreimer / LICENSE
Last active August 29, 2023 14:28
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
MIT License
Copyright (c) 2020 Jan Heinrich Reimer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@heinrichreimer
heinrichreimer / ListAdapter.java
Last active March 17, 2016 21:31
A RecyclerView.Adapter which can be used as a List and notifies the RecyclerView of every changes to the contained data.
package com.heinrichreimersoftware.playstorewatcher.adapters;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
@heinrichreimer
heinrichreimer / extract_app_income_google_merchant.py
Last active March 30, 2017 01:50
This script helps you to calculate the total income from a Google merchants payment report CSV file.
#!/usr/bin/env python
import csv
import sys
import os.path
from decimal import Decimal
def endswith_case_insensitive(a, b):
a_lower = a.lower()
@heinrichreimer
heinrichreimer / CLA.md
Last active January 2, 2020 21:52
Contributor License Agreement (Jan Heinrich Reimer)

Fiduciary License Agreement 2.0

(Based on the Individual Contributor exclusive License Agreement, including the Traditional Patent License option)

Thank you for your interest in contributing to Jan Heinrich Reimer's GitHub open source projects ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us. To make this document effective, please follow the instructions at https://cla-assistant.io/heinrichreimer/.

Preamble

Software is deeply embedded in all aspects of our lives and it is important that it empower, rather than restrict us. Free Software gives everybody the rights to use, understand, adapt and share software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.

@heinrichreimer
heinrichreimer / CONTRIBUTION_TEMPLATE.md
Last active March 30, 2017 02:04
This contribution guidelines provide useful information and basic rules for contributing to Heinrich Reimer Software open source projects.

Contributing Guidelines