Skip to content

Instantly share code, notes, and snippets.

View grantland's full-sized avatar

Grantland Chew grantland

View GitHub Profile
@grantland
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
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
grantland / AGB-001_Light_Mod.md
Last active January 25, 2023 15:12
AGB-001 Front/Backlight Mod Instructions

AGB-001 Front/Backlight Mod Instructions

AGB-001 Backlight Mod

Requirements

  • 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/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
@grantland
grantland / README.md
Last active August 1, 2024 14:31
NextBus API
@grantland
grantland / post.md
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

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 September 26, 2017 15:49
Enabling Auto-Rotate Quick Settings Toggle on Phones
@grantland
grantland / gist:3989521
Created October 31, 2012 20:12
Printing stack traces in iOS 5+
// 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
{