Skip to content

Instantly share code, notes, and snippets.

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:

@mikepenz
mikepenz / multitail.md
Last active February 28, 2021 15:42
Install & Configure multitail, Configure multitail, Setup alias

#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

Verifying that +mikepenz is my Bitcoin username. You can send me #bitcoin here: https://onename.io/mikepenz
@mikepenz
mikepenz / bootstrap-table-sample-api.php
Last active November 25, 2022 10:24
Sample API for the bootstrap-table
<?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 {
@mikepenz
mikepenz / CachingUtil.java
Created July 29, 2015 06:58
A small util class to store any data (single or list) and load it again
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 / debianessentials.md
Last active February 2, 2017 10:08
Install & Configure Debian Essentials

#ABOUT

#INSTALLATION Run following commands:

apt-get install curl -y
curl https://gist.githubusercontent.com/mikepenz/bea8ef149c4c04917f04/raw/7fded476f46b156e3bc3cb8b0696fa27267c6b78/debianessentials.sh | sh;
@mikepenz
mikepenz / README.md
Last active October 13, 2016 19:25
Syncs a defined branch from a forked GIT project with the external root directory

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 / ContainerItem.java
Created December 14, 2016 22:04
quick and dirty ContainerItem for the FastAdapter
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 / some-root.gradle
Last active July 27, 2017 12:20
android-gradle-logger
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 / android-adb-usb-speed.sh
Created November 12, 2019 11:28
Quick helper script to detect the speed of the USB connection of connected Android devices
#!/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)