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
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
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
grantland / AGB-001_Light_Mod.md
Last active Nov 13, 2019
AGB-001 Front/Backlight Mod Instructions
View AGB-001_Light_Mod.md

AGB-001 Front/Backlight Mod Instructions

AGB-001 Backlight Mod

Requirements

  • 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/libandroid.so /system/lib64/libandroid_servers.so /system/lib64/libaudioeffect_jni.so /system/lib64/libcompiler_rt.so /system/lib64/libjavacrypto.so /system/lib64/libjnigraphics.so /system/lib64/libmedia_jni.so /system/lib64/librs_jni.so /system/lib64/libsoundpool.so /system/lib64/libwebviewchromium_loader.so /system/lib64/libwifi-service.so libjavacore.so (12)
Heap: 1% free, 10MB/10MB; 148650 objects
View README.md
@grantland
grantland / post.md
Last active Aug 15, 2019
RecyclerView item onClick
View post.md

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
View Executors.java
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.
View android_development.md

Android Development

Gradle

Enable Gradle Daemon

Speed up Gradle build times by enabling the Gradle Daemon

echo org.gradle.daemon=true >> ~/.gradle/gradle.properties
@grantland
grantland / gist:5464067
Last active Sep 26, 2017
Enabling Auto-Rotate Quick Settings Toggle on Phones
View gist:5464067
@grantland
grantland / gist:3989521
Created Oct 31, 2012
Printing stack traces in iOS 5+
View gist:3989521
// source: http://stackoverflow.com/questions/7841610/xcode-4-2-debug-doesnt-symbolicate-stack-call
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.