Skip to content

Instantly share code, notes, and snippets.

👻

Mike Penz mikepenz

👻
View GitHub Profile
@mikepenz
mikepenz / android-adb-usb-speed.sh
Created Nov 12, 2019
Quick helper script to detect the speed of the USB connection of connected Android devices
View android-adb-usb-speed.sh
#!/bin/bash
# some helper vars
# https://unix.stackexchange.com/a/10065/138249
if test -t 1; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold=$(tput bold)
normal=$(tput sgr0)
success=$(tput setaf 2)
@mikepenz
mikepenz / some-root.gradle
Last active Jul 27, 2017
android-gradle-logger
View some-root.gradle
gradle.taskGraph.afterTask { task, state ->
if (task. state.failure) {
println "$task.name FAILED PRINTING LOGS"
getDevicesAndReadLogs(500)
}
}
ext.getDevicesAndReadLogs = { count = 2500 ->
try {
def outstream = new ByteArrayOutputStream()
@mikepenz
mikepenz / ContainerItem.java
Created Dec 14, 2016
quick and dirty ContainerItem for the FastAdapter
View ContainerItem.java
package com.fyusion.fyuse.item;
import android.content.Context;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@mikepenz
mikepenz / README.md
Last active Oct 13, 2016
Syncs a defined branch from a forked GIT project with the external root directory
View README.md

gitSync.sh

Why?

  • syncing with the main repo if we already have changes is a pain

Configure

  • define remoteOrigin (the external remote name of the root repo)
  • define ownOrigin (the remote name of our fork)
  • define syncBranch (the branch which we will get in sync)
@mikepenz
mikepenz / debianessentials.md
Last active Feb 2, 2017
Install & Configure Debian Essentials
View debianessentials.md

#ABOUT

#INSTALLATION Run following commands:

apt-get install curl -y
curl https://gist.githubusercontent.com/mikepenz/bea8ef149c4c04917f04/raw/7fded476f46b156e3bc3cb8b0696fa27267c6b78/debianessentials.sh | sh;
@mikepenz
mikepenz / CachingUtil.java
Created Jul 29, 2015
A small util class to store any data (single or list) and load it again
View CachingUtil.java
public class CachingUtil {
public <C> List<C> loadParsed(Class<C> type, String locale) {
String name = getName(type);
Path path = Paths.get(Config.getEntry("paths.cache") + "/" + name + "/", name + "." + locale + ".json");
if (Files.exists(path) && !Files.isDirectory(path)) {
try {
return new ObjectMapper()
.readValue(path.toFile(), new ObjectMapper().getTypeFactory().constructCollectionType(List.class, type));
@mikepenz
mikepenz / bootstrap-table-sample-api.php
Last active Sep 7, 2017
Sample API for the bootstrap-table
View bootstrap-table-sample-api.php
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
require "JSONDB.php";
if(isset($_GET["limit"])) {
$limit = $_GET["limit"];
} else {
View gist:17d9c4f06b6b8f88f49d
Verifying that +mikepenz is my Bitcoin username. You can send me #bitcoin here: https://onename.io/mikepenz
@mikepenz
mikepenz / multitail.md
Last active Apr 16, 2019
Install & Configure multitail, Configure multitail, Setup alias
View multitail.md

#ABOUT

#INSTALLATION Run following commands:

curl https://gist.githubusercontent.com/mikepenz/a8a4a52f67a391895a4c/raw/0e142a381ddce88e7489d0753388bd9778cb246d/multitail.sh | sh;
source ~/.bashrc

This will start the script multitail.sh and call source ~/.bashrc afterwards

View keybase.md

Keybase proof

I hereby claim:

  • I am mikepenz on github.
  • I am mikepenz (https://keybase.io/mikepenz) on keybase.
  • I have a public key whose fingerprint is A8A7 C696 5609 A7AD 1401 ABC5 AA94 1A4D 9FB0 053F

To claim this, I am signing this object:

You can’t perform that action at this time.