Skip to content

Instantly share code, notes, and snippets.

Avatar

Marshall Culpepper marshall

View GitHub Profile
@marshall
marshall / ClassLoaderActivity.java
Created Feb 22, 2011
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
View ClassLoaderActivity.java
//
// !!WARNING: Not recommended for production code!!
//
public class ClassLoaderActivity extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader());
setAPKClassLoader(dexLoader);
@marshall
marshall / dump-extension-data.sh
Last active Nov 6, 2020
Dump a Brave extension's LevelDB json data from command line
View dump-extension-data.sh
#!/bin/bash
set -e
LEVELDB_CLI=$HOME/go/bin/leveldb-cli
EXTENSION=${EXTENSION:-odbfpeeihdkbihmopkbjmoonfanlbfcl} # default is Crypto Wallets
PROFILE=${PROFILE:-"$HOME/Library/Application Support/BraveSoftware/Brave-Browser-Nightly"} # default nightly profile
FORMATTER=
if which jq 1>/dev/null 2>/dev/null; then
FORMATTER="jq ."
View brave-bitgo-branch-rebase-notes.md
View kubos_cargo.zsh
get_cpu_count() {
python -c 'import multiprocessing as mp; print(mp.cpu_count())'
}
CPU_COUNT=$(get_cpu_count)
kubos_cargo() {
# NOTE: this assumes we're building something that's a subdir of $HOME/Code
typeset -a o_target
o_projects=(--project "$PWD")
View kubos_linux_cla.md

Harmony Individual Contributor Assignment Agreement

Thank you for your interest in contributing to Kubos Corporation (“We” or “Us”).

This contributor agreement (“Agreement”) documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by mail, email, fax, or electronic submission, following the instructions at https://docs.kubos.com/latest/dev-docs/contribution-process.html. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.

Definitions

“You” means the individual who Submits a Contribution to Us.

@marshall
marshall / app.js
Created Jan 27, 2011
Sample proguard configuration for a basic Titanium App
View app.js
var win = Ti.UI.createWindow({
backgroundColor: 'white',
top: 0, left: 0, right: 0, bottom: 0,
layout: "vertical"
});
var button = Ti.UI.createButton({
title: "click me"
});
win.add(button);
@marshall
marshall / tupper_k_generator.md
Last active Nov 27, 2018
Tupper's self referential formula K-value generator from any bitmap
View tupper_k_generator.md

I blame Sunil

Explanation on Numberphile

$ ./tupper_k_generator.py kubos-logo.jpg
Tupper K: 4851370081043797069526117009366050436467169751191993569135606414438862155770371453584241289040123540835764290480748106579297469000745823841698473083200214756261314470995838411716498141137319883748891932220617163646559245337601667812194386638446130000791689630544645547109043549304112488869690412062712162943919296994357984460429601612633008740350419376958008239159705920690443436571886095990169981093140964956940930188836731629337704527351542629178213799422991411377275182604582346155731146214167261974801893205797483642065625014903535782819823

Test your number here! http://tuppers-formula.tk/

For reference, my company's logo (the test above) looks pretty cool in monochrome!

View malloc_lock.diff
diff --git a/hal/kubos-hal-stm32f4/source/malloc_check.cmake b/hal/kubos-hal-stm32f4/source/malloc_check.cmake
new file mode 100644
index 0000000..3f8ea04
--- /dev/null
+++ b/hal/kubos-hal-stm32f4/source/malloc_check.cmake
@@ -0,0 +1,3 @@
+include(CheckCSourceCompiles)
+
+check_c_source_compiles("#include <reent.h>\nvoid __malloc_lock(struct _reent *r){}\n void __malloc_unlock(struct _reent *r){}int main(){return 0;}" USE_MALLOC_LOCK)
diff --git a/hal/kubos-hal-stm32f4/source/syscalls.c b/hal/kubos-hal-stm32f4/source/syscalls.c
@marshall
marshall / adb_kill.py
Created Feb 1, 2011
kill a running android process without eclipse
View adb_kill.py
#
# Kill a running Android JDWP (debuggable) process without Eclipse
#
import sys
import socket
import struct
import uuid
import random
import subprocess
@marshall
marshall / README.md
Created May 17, 2016
Anarduino MiniWireless RF96W prototype
View README.md

Requires installation of the RadioHead library into Arduino IDE 1.7 to talk to the HopeRF chip embedded on the Anarduino MiniWireless-96-433

Before trying to program the board, in the Arduino menu, select Tools > Board > Arduino Pro or Pro Mini