Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Heinrich Reimer heinrichreimer

View GitHub Profile
@heinrichreimer
heinrichreimer / redirect.html
Last active Mar 30, 2017
Redirect to any other webpage. (JS required)
View redirect.html
<script type="text/javascript">
<!--
window.location = "https://www.heinrichreimer.com/";
//–>
</script>
@heinrichreimer
heinrichreimer / hidden.css
Created Sep 24, 2013
Hide all elements with attribute "hidden"
View hidden.css
[hidden]{
display:none;
}
View validate_url.php
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
Use android wallpaper as activity background
View background_wallpaper_styles.xml
<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 Apr 26, 2021
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
View SpanningGridLayoutManager.java
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 Jul 27, 2021
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
View LICENSE
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 Mar 17, 2016
A RecyclerView.Adapter which can be used as a List and notifies the RecyclerView of every changes to the contained data.
View ListAdapter.java
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 Mar 30, 2017
This script helps you to calculate the total income from a Google merchants payment report CSV file.
View extract_app_income_google_merchant.py
#!/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 Jan 2, 2020
Contributor License Agreement (Jan Heinrich Reimer)
View CLA.md

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 Mar 30, 2017
This contribution guidelines provide useful information and basic rules for contributing to Heinrich Reimer Software open source projects.
View CONTRIBUTION_TEMPLATE.md

Contributing Guidelines