Skip to content

Instantly share code, notes, and snippets.

View felHR85's full-sized avatar
🐓
Slow but steady wins the race

Felipe Herranz felHR85

🐓
Slow but steady wins the race
View GitHub Profile
@LanderlYoung
LanderlYoung / android_dump_java_heap.sh
Created December 20, 2017 04:09
script to dump android java heap and convert use hprof-conv
ADB=${ANDROID_HOME}/platform-tools/adb
HPROF_CONV=${ANDROID_HOME}/platform-tools/hprof-conv
# customized functions
# dump droid heap
function droid_hd() {
PACKAGE_NAME=$1
TIME=$(date +"%Y%m%d_%H%M%S")
FILE_NAME="${PACKAGE_NAME}-${TIME}-heap.hprof"
@safferli
safferli / metacritic-api.r
Last active November 12, 2017 16:40
Query the (unofficial) Mashape metacritic game API in R
## Usage:
## 1) sign up to the Mashape API to get metacritic data: https://market.mashape.com/byroredux/metacritic-v2
## 2) save your Mashape API key in your .Renviron as Mashape.key
## 3) generate a character vector of games you want to query
## 4a) call f.generate.metacritic.data(game.vector) to generate a dataframe of the results
## 4b) alternatively, call f.call.metacritic.API(game) if you want to only call the API for one game (returns the API result, not a dataframe)
library(httr)
library(jsonlite)
library(dplyr)
@sentinelt
sentinelt / gist:3f1a984533556cf890d9
Created February 6, 2015 18:44
Program to set arbitrary speed
/*
* Allows to set arbitrary speed for the serial device on Linux.
* stty allows to set only predefined values: 9600, 19200, 38400, 57600, 115200, 230400, 460800.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <asm/termios.h>
int main(int argc, char* argv[]) {
@felHR85
felHR85 / SoftKeyboard.java
Last active February 17, 2024 23:11
A solution to catch show/hide soft keyboard events in Android http://felhr85.net/2014/05/04/catch-soft-keyboard-showhidden-events-in-android/
/*
* Author: Felipe Herranz (felhr85@gmail.com)
* Contributors:Francesco Verheye (verheye.francesco@gmail.com)
* Israel Dominguez (dominguez.israel@gmail.com)
*/
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.os.Handler;
@scottyab
scottyab / SignatureCheck.java
Last active January 30, 2024 15:22
Simple Android signature check. Please note: This was created in 2013, not actively maintained and may not be compatible with the latest Android versions. It's not particularly difficult for an attacker to decompile an .apk, find this tamper check, replace the APP_SIGNATURE with theirs and rebuild (or use method hooking to return true from `vali…
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
public class TamperCheck {
//we store the hash of the signture for a little more protection
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@bengfarrell
bengfarrell / SimpleViewerCustom.java
Created December 12, 2012 02:05
Customized version of SimpleViewer sample from OpenNI where we combine depth and RGB data
/****************************************************************************
* *
* OpenNI 1.x Alpha *
* Copyright (C) 2011 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* OpenNI is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
@leebyron
leebyron / latlong.pde
Created May 29, 2011 03:50
conversions from Lat/long to 2d map projections - for Processing
/**
* A collection of functions responsible for performing translations between
* longitude/latitude coordinates and points on a 1/1 square
* (which you could then map to pixelspace)
*
* @author leebyron
*/
/**
* lon double x coordinate in radians [-PI,PI)