Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Heinrich Reimer heinrichreimer

View GitHub Profile
@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 / 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 / DataBindingRecyclerViewAdapter.java
Last active Mar 23, 2017
RecyclerView adapter class for using data binding to replace view inflation.
View DataBindingRecyclerViewAdapter.java
package foo.bar;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.util.List;
@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 / 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 / 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

@heinrichreimer
heinrichreimer / refresh-portfolio.sh
Created Feb 4, 2018
Script that runs on my web server and fetches, builds and deploys my personal portfolio. Portfolio sources can be found here: https://github.com/heinrichreimer/heinrichreimer.github.io
View refresh-portfolio.sh
#!/usr/bin/env bash
set -e # Halt script on error.
# GitHub repo to fetch the portfolio from.
PORTFOLIO_REPO_USERNAME=heinrichreimer
PORTFOLIO_REPO_NAME=heinrichreimer.github.io
# Path to deploy the portfolio to.
PORTFOLIO_DEPLOY_PATH=~/www/heinrichreimer.com
@heinrichreimer
heinrichreimer / Wysker_Launchfilm_1_1_4_Metadata.xml
Created Feb 14, 2018
Metadata embedded into the Wysker_Launchfilm_1_1_4.mp4 file of the Wysker treasure hunt: https://www.youtube.com/watch?v=Ajhyirdd9CE
View Wysker_Launchfilm_1_1_4_Metadata.xml
<?xml version="1.0"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c143 79.161210, 2017/08/11-10:28:36 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/" xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/" xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/" xmlns:creatorAtom="http://ns.adobe.com/creatorAtom/1.0/" xmlns:bext="http://ns.adobe.com/bwf/bext/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:tiff="http://ns.adobe.com/t
@heinrichreimer
heinrichreimer / gist:0c84119ab9de42fd371918f2e9fb024d
Created Apr 6, 2018
Delete unused, pre-installed Windows Apps
View gist:0c84119ab9de42fd371918f2e9fb024d
Get-AppxPackage -allusers *Microsoft.BingWeather* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsMaps* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.ZuneVideo* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.OneConnect* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.ZuneMusic* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.GetHelp* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.People* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsCommunicationsApps* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage