Skip to content

Instantly share code, notes, and snippets.

View ItsHarper's full-sized avatar

Harper Andrews ItsHarper

View GitHub Profile
@gnuton
gnuton / gist:5704247
Created June 4, 2013 07:36
Android: How to display rich text in a textView
TextView tv = (TextView)findViewById(R.id.mytextview);
Spanned myStringSpanned = Html.fromHtml(myString, null, null);
tv.setText(myStringSpanned, TextView.BufferType.SPANNABLE);
Supporte TAGS on Android 2.1
<a href="...">
<b>
<big>
<blockquote>
<br>
@archeg
archeg / gist:8333021
Created January 9, 2014 11:58
Example of code that uses HID for Android to connect to the device through USB.
package com.company.app.PlatformMethods;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@benjchristensen
benjchristensen / EventBus.java
Last active December 23, 2025 06:55
EventBus.java
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
/**
* Simple pass-thru event bus with error handling and reconnect.
*/
public class EventBus {
@joswr1ght
joswr1ght / colorpromptnewline.txt
Created October 25, 2015 16:43
Colorful Terminal Prompt with Directory on a Separate Line
PS1="\[\033[01;34m\]\w\[\033[00m\]\n\$ "
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active February 3, 2026 15:39
An Open Letter to Developers Everywhere (About Cryptography)
@race604
race604 / adb+
Last active August 20, 2023 09:03
#!/bin/bash
# Script adb+
# Run any command adb provides on all your currently connected devices,
# Or prompt to select one device
showHelp() {
echo "Usage: adb+ [-a] <command>"
echo " -h: show help"
echo " -a: run command on all device"
echo " command: normal adb commands"
@mosquito
mosquito / README.md
Last active February 19, 2026 04:21
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@bubbleguuum
bubbleguuum / CachedDocumentFile.java
Last active October 23, 2023 22:26
Improve DocumentFile performance
package android.support.v4.provider;
import android.net.Uri;
import android.support.v4.provider.DocumentFile;
public class CachedDocumentFile extends DocumentFile {
final DocumentFile mWrapped;
final boolean mCacheChildren;
@5484Enderbots
5484Enderbots / ClosableVuforiaLocalizer.java
Created October 1, 2017 17:37
A drop-in replacement for VuforiaLocalizer that can be detached from the camera before the opmode ends.
package org.firstinspires.ftc.teamcode;
import org.firstinspires.ftc.robotcore.internal.vuforia.VuforiaLocalizerImpl;
/**
* Copyright (c) 2017 FTC Team 5484 Enderbots
* 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
package org.firstinspires.ftc.robotcontroller.internal;
import java.lang.Thread.UncaughtExceptionHandler;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.util.Log;