Skip to content

Instantly share code, notes, and snippets.

View grantland's full-sized avatar

Grantland Chew grantland

View GitHub Profile
grantland / hexalter.cpp
Created October 2, 2015 07:07 — forked from Jakz/hexalter.cpp
Simple cmmand line byte modifier that replaces raw bytes inside a given file
#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;
struct Patch
grantland / sleephack.cpp
Created October 2, 2015 07:07 — forked from Jakz/sleephack.cpp
GBA Sleep Hack
#include <cstdio>
#include <cassert>
#include <stdint.h>
#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
grantland /
Last active January 25, 2023 15:12
AGB-001 Front/Backlight Mod Instructions

AGB-001 Front/Backlight Mod Instructions

AGB-001 Backlight Mod


  • AGB-001
  • ASS101 screen
----- pid 1297 at 2015-03-11 19:47:34 -----
Cmd line: system_server
ABI: x86_64
Build type: optimized
Zygote loaded classes=3593 post zygote classes=2212
Intern table: 38395 strong; 1947 weak
JNI: CheckJNI is on; globals=826 (plus 15 weak)
Libraries: /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ /system/lib64/ (12)
Heap: 1% free, 10MB/10MB; 148650 objects
grantland /
Last active January 25, 2024 23:09
NextBus API
grantland /
Last active February 9, 2023 05:09
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
import android.annotation.TargetApi;
import android.os.Build;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
* Created by Grantland Chew on 11/14/13.

Android Development


Enable Gradle Daemon

Speed up Gradle build times by enabling the Gradle Daemon

echo org.gradle.daemon=true >> ~/.gradle/
grantland / gist:5464067
Last active September 26, 2017 15:49
Enabling Auto-Rotate Quick Settings Toggle on Phones
grantland / gist:3989521
Created October 31, 2012 20:12
Printing stack traces in iOS 5+
// source:
void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions