Skip to content

Instantly share code, notes, and snippets.

View Tobi823's full-sized avatar

Tobias Hellmann Tobi823

View GitHub Profile
@fredchung
fredchung / AndroidManifest.xml
Created September 7, 2020 06:10
Foreground service type declaration for WorkManager long running workers.
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="location|microphone"
tools:node="merge" />
@Farbklex
Farbklex / ConnectivityChecker.kt
Created February 18, 2020 13:27
Android: Check if the device has internet access on devices with API level >= 23.
package me.a_hoffmann.gists
import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
/**
* Checks if the device has an internet connection.
* NOTE: Works only on android API level 23 and above!
*/
@artizirk
artizirk / debug.md
Last active June 20, 2024 23:32
Debug WireGuard Linux kernel module
@simoncos
simoncos / golang_on_rpi.md
Last active March 30, 2024 17:56 — forked from konradko/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

@PaulFurtado
PaulFurtado / usb_reset.py
Last active June 22, 2024 22:44
Reset USB device from python
"""
Example code for resetting the USB port that a Teensy microcontroller is
attached to. There are a lot of situations where a Teensy or Arduino can
end up in a bad state and need resetting, this code is useful for
"""
import os
import fcntl
import subprocess
@mismatch
mismatch / JpaRepositoriesConfig.java
Created August 10, 2014 06:45
Spring Boot. Multiple DB repositories configuration example
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan.Filter;
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */