Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Strict mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
#
# Usage: script -f fileToPull -p packageName
#
@eurycea
eurycea / Something.java
Last active February 8, 2021 06:31
Android Build Config Field from command line
...
if(BuildConfig.DEVELOPER_MODE){
doDeveloperModeThing();
}
...
@eurycea
eurycea / BlockBreaker.java
Last active August 29, 2015 14:22
Playing with FileInputStream and crc
import org.apache.commons.codec.binary.Hex;
import sun.misc.CRC16;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
@eurycea
eurycea / Tooth.java
Last active August 29, 2015 14:21
playing with rxjava and ble
package com.example.scan
import org.uribeacon.scan.compat.BluetoothLeScannerCompat;
import org.uribeacon.scan.compat.BluetoothLeScannerCompatProvider;
import org.uribeacon.scan.compat.ScanCallback;
import org.uribeacon.scan.compat.ScanResult;
import android.content.Context;
import android.util.Log;
import java.util.List;
import rx.Observable;
@eurycea
eurycea / no_body.py
Last active August 29, 2015 14:20
empty response body debugging
from flask import Flask
app = Flask(__name__)
@app.route("/", methods=['POST'])
def nobody():
return ""
if __name__ == "__main__":
app.run(host='0.0.0.0')
@eurycea
eurycea / human_android_strings.py
Created May 6, 2015 16:41
strip xml from android strings.xml for a simple human readable output
import xml.etree.ElementTree as ET
def parse_text(line):
clean_line = line
clean_line = clean_line.replace("…", "...")
clean_line = clean_line.replace("\u2020", "")
clean_line = clean_line.replace("–", "-")
clean_line = clean_line.replace("©", "(copy)")
element = ET.fromstring(clean_line)
return element.text