Skip to content

Instantly share code, notes, and snippets.

View brodybits's full-sized avatar

Chris Brody brodybits

View GitHub Profile
@brodybits
brodybits / android-emulator-homebrew.sh
Last active April 5, 2021 06:09 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
# 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 August 3, 2018 04:56 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

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 January 4, 2018 15:44 — 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)
/* 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 December 11, 2017 03:25 — forked from AlainODea/HelloCovariance.java
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
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 November 9, 2017 17:07 — forked from gchudnov/cpp_utf8_utf16.cpp
C++ string conversion UTF8 <-> UTF16
#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);