Skip to content

Instantly share code, notes, and snippets.

Chris Brody brodybits

View GitHub Profile
@brodybits
brodybits / android-emulator-homebrew.sh
Last active Mar 31, 2019 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
View android-emulator-homebrew.sh
# Recommended prerequisites:
# - Xcode is installed
# - Homebrew is installed - I am using a custom subdirectory as described in:
# - https://superuser.com/questions/1336025/how-should-i-install-homebrew-into-usr-local-subdirectory-manually
# - OpenJDK 8 is installed - here are a couple recommended resources:
# - https://apple.stackexchange.com/questions/349465/how-can-i-upgrade-from-oracle-jdk-8-to-openjdk-8-using-homebrew
# - https://dzone.com/articles/install-openjdk-versions-on-the-mac - good but shows formulae that I did not see
# - brew doctor does not show any issues
# I think this is not needed any more:
@brodybits
brodybits / howto-filemerge-git-osx.md
Created Aug 3, 2018 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX
View howto-filemerge-git-osx.md

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@brodybits
brodybits / executeSqlBridgeForPhonegapSQLitePlugin.js
Last active Jan 4, 2018 — forked from orbitaloop/executeSqlBridgeForPhonegapSQLitePlugin.js
executeSql Bridge For ORIGINAL @davibe PhonegapSQLitePlugin ONLY (because there are some differences between the WebSQL API and the ORIGINAL @davibe plugin)
View executeSqlBridgeForPhonegapSQLitePlugin.js
/* to use WebSQL or the SQLite plugin (https://github.com/davibe/Phonegap-SQLitePlugin) with the same function) */
executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) {
var self = this;
if (typeof self.db.dbPath !== 'undefined') {
//Native SQLite DB with phonegap : https://github.com/davibe/Phonegap-SQLitePlugin/
//this is a native DB, the method signature is different:
var sqlAndParams = [sql].concat(params);
var cb = function(res) {
@brodybits
brodybits / HelloCovariance.java
Created Dec 11, 2017 — forked from AlainODea/HelloCovariance.java
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
View HelloCovariance.java
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class HelloCovariance {
public static void main(String[] args) {
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>();
Set<String> keySet = properties.keySet();
}
}
@brodybits
brodybits / cpp_utf8_utf16.cpp
Created Nov 9, 2017 — forked from gchudnov/cpp_utf8_utf16.cpp
C++ string conversion UTF8 <-> UTF16
View cpp_utf8_utf16.cpp
#include <string>
#include <locale>
#include <codecvt>
//UTF-8 to UTF-16
std::string source;
//...
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
std::u16string dest = convert.from_bytes(source);
@brodybits
brodybits / A-simple-case-for-JavaScript-closures.txt
Last active Nov 2, 2016
A simple case for JavaScript closures
View A-simple-case-for-JavaScript-closures.txt
CREDIT FOR INSPIRATION:
http://www.w3schools.com/js/js_function_closures.asp
ORIGINAL PURPOSE:
This is to help address a Flow Based Programming discussion comment at:
https://groups.google.com/d/msg/flow-based-programming/SckVpqE5IZM/ldeBRp5hAwAJ
The W3 schools sample above presents an easy to understand explanation of
@brodybits
brodybits / README.txt
Created Jul 12, 2016
Proposal: fix SQLITE_OMIT_FLOATING_POINT for SQLite 77c692a6 (trunk)
View README.txt
If I build SQLite 77c692a6 (trunk) with CFLAGS="-DSQLITE_OMIT_FLOATING_POINT"
I get a bunch of errors. Here is a patch in 3 parts that would fix this issue:
* SQLite-77c692a6-double-fix-part-1.diff - fix sqlite.h.in to use a proper
typedef to define a new sqlite_double typedef instead of using a macro
to overwrite double
* SQLite-77c692a6-double-fix-part-2.diff - fix other headers to use
the new sqlite_double typedef instead of double
@brodybits
brodybits / Android-SQLCipher-MultiThreadReadWriteTest-sample-DatabaseObjectNotClosedException-errors-log.txt
Created May 29, 2015
Partial output of Android SQLCipher MultiThreadReadWriteTest that crashed, with some DatabaseObjectNotClosedException errors
View Android-SQLCipher-MultiThreadReadWriteTest-sample-DatabaseObjectNotClosedException-errors-log.txt
NOTE: this is for https://github.com/sqlcipher/android-database-sqlcipher/issues/176
===
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:223, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:193, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:224, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:194, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:225, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:226, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:195, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:196, a:one for the money b:two for the show
@brodybits
brodybits / Android-SQLCipher-MultiThreadReadWriteTest-crash-log.txt
Created May 29, 2015
Full output of Android SQLCipher MultiThreadReadWriteTest that crashed with net.sqlcipher.database.SQLiteMisuseException: library routine called out of sequence
View Android-SQLCipher-MultiThreadReadWriteTest-crash-log.txt
NOTE: this is for https://github.com/sqlcipher/android-database-sqlcipher/issues/176
===
I/Zetetic ( 6187): Running test:Multi-threaded read/write test
I/net.zetetic.sqlcipher.test( 6187): Unicode (ICU) Test - success:true
I/MultiThreadReadWriteTest( 6187): Starting writer thread 0
I/MultiThreadReadWriteTest( 6187): Starting writer thread 1
I/MultiThreadReadWriteTest( 6187): Starting writer thread 2
I/MultiThreadReadWriteTest( 6187): Starting writer thread 3
I/MultiThreadReadWriteTest( 6187): Starting writer thread 4
I/MultiThreadReadWriteTest( 6187): Starting writer thread 5
You can’t perform that action at this time.