Skip to content

Instantly share code, notes, and snippets.

View RareScrap's full-sized avatar

Yuri RareScrap

View GitHub Profile
@nstarke
nstarke / release-android-debuggable.md
Last active November 23, 2025 00:49
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@gfpacheco
gfpacheco / RadioGridGroup.java
Created June 4, 2015 01:04
A GridLayout subclass that serves as RadioButton group and has same methods than original RadioGroup
package com.gfpacheco.views.widget;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatRadioButton;
import android.support.v7.widget.GridLayout;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@sveinungkb
sveinungkb / AdnroidFieldNamingPolicy.java
Last active April 18, 2020 17:02
GSON Field naming policy taking Android m-prefix into account (e.g. mField and mHomeAddress).
package co.sveinung.utils;
import com.google.gson.FieldNamingStrategy;
import java.lang.reflect.Field;
import java.util.regex.Pattern;
/**
* Created by sveinung on 21.02.15.
*/
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active November 15, 2025 16:37
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
package com.multimote.microz.gui.elements;
import com.multimote.microz.gui.ScreenTools;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import org.lwjgl.opengl.GL11;
/**
* Created by multimote on 12.07.14.
@PatriotBob
PatriotBob / BetterBlockBase.java
Last active April 25, 2018 14:33
Generic block container
package carpentersblocks.block;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.entity.Entity;
@jwebcat
jwebcat / gist:5122366
Last active October 9, 2025 13:52 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@joshdholtz
joshdholtz / SomeFragment.java
Last active December 22, 2022 09:41
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
@thvortex
thvortex / GuiTexturedRect.java
Created March 20, 2012 17:14
Drawing a textured rectangle in a Minecraft GUI
// HOW TO DRAW A TEXTURED RECTANGLE IN A MINECRAFT GUI WITH THE TEXTURE SCALED TO FIT
//
//
// 1. You need an instance of RenderEngine. Using ModLoader you can obtain it with:
//
RenderEngine renderEngine = ModLoader.getMinecraftInstance().renderEngine;
// 2a. When your mod first starts, you need to load your texture into OpenGL. If your image
// file is on the classpath (i.e. inside minecraft.jar or inside your own mod's jar) then
// you can load it easily. Your image file should contain an alpha layer with only 0 or 255