Skip to content

Instantly share code, notes, and snippets.

Grantland Chew grantland

Block or report user

Report or block grantland

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

AGB-001 Front/Backlight Mod Instructions

AGB-001 Backlight Mod


  • AGB-001
  • ASS101 screen
View traces.txt
----- 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 Aug 15, 2019
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 Sep 26, 2017
Enabling Auto-Rotate Quick Settings Toggle on Phones
View gist:5464067
grantland / gist:3989521
Created Oct 31, 2012
Printing stack traces in iOS 5+
View gist:3989521
// source:
void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
You can’t perform that action at this time.