Skip to content

Instantly share code, notes, and snippets.

PackageInfo info;
try {
info = getPackageManager().getPackageInfo("ecentinela.mercadotes", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
@munho
munho / Gemfile
Created March 20, 2017 11:26
json-1.8.3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. #253
gem 'json', github: 'flori/json', branch: 'v1.8'
https://github.com/flori/json/issues/253#issuecomment-270294986
@munho
munho / LocalBroadcastExampleActivity.java
Last active March 22, 2017 00:27 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@munho
munho / install_all_pods.sh
Created April 18, 2017 22:51
install_all_pods.sh
dirs=$(find . -name Podfile -print0 | xargs -0 -n1 dirname | sort --unique)
top=$(pwd)
for dir in $dirs
do
cd "$dir"
pod install
cd "$top"
done
@munho
munho / echo_nc.sh
Created May 3, 2017 23:33 — forked from NapoleonWils0n/echo_nc.sh
bash: hex over tcp with netcat and echo
#!/bin/sh
#----------------------------------------------------------------------------------------#
# Hex over TCP with Echo and Netcat #
#----------------------------------------------------------------------------------------#
echo -n -e "x01x18x03" | nc 192.168.1.4 80
# The -n supresses outputting the trailing newline.
# The -e enables the interpretation of backslash escapes -- allowing us to send hex codes.
@munho
munho / reinstall_brew.sh
Created May 8, 2017 08:27
reinstall homebrew
#!/bin/bash
# https://github.com/Homebrew/homebrew/issues/31125
for i in `brew list -1`
do
if [[ "$i" == python.* ]] || [[ "$i" == ruby.* ]] || [[ "$i" == android-* ]]
then
continue
fi
brew rm --force $i && brew install $i
@munho
munho / AddCookiesInterceptor.java
Created May 12, 2017 04:45 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
@munho
munho / Info.plist
Created June 26, 2017 03:16 — forked from BalestraPatrick/Info.plist
Custom URL scheme Launch Storyboard Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
package com.alexzh.recyclerviewsetemptyview;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
public class EmptyRecyclerView extends RecyclerView {
private View mEmptyView;
@munho
munho / RxJava.md
Created August 24, 2017 01:04 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)