Skip to content

Instantly share code, notes, and snippets.

Angel Leon gubatron

Block or report user

Report or block gubatron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gubatron /
Last active May 11, 2019
NDK architectures, toolsets and toolchains



  • CC=$ANDROID_TOOLCHAIN/bin/i686-linux-android-clang
  • linux-elf
  • toolset=clang-x86


  • CC=$ANDROID_TOOLCHAIN/bin/x86_64-linux-android-clang;
  • linux-x86_64
gubatron /
Created Apr 9, 2019
Creating a custom JDK 12
# compress = 1 -> shared strings
# compress = 2 -> zip
# if we use shared strings and then do lzma on a tar we go down to 14M .lzma file
jlink --no-header-files --no-man-pages --compress=1 --strip-debug --add-modules java.base,java.compiler,java.desktop,java.instrument,,java.naming,java.prefs,java.scripting,java.sql --output frostwire-jre.nozip
#jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.compiler,java.desktop,java.instrument,,java.naming,java.prefs,java.scripting,java.sql --output frostwire-jre
tar cvf frostwire-jre.nozip.tar frostwire-jre.nozip
lzma -k -z -0 -e --threads=4 -v frostwire-jre.nozip.tar
gubatron / cmake_clean
Created Mar 28, 2019
cmake_clean bash script
View cmake_clean
#!/usr/bin/env bash
function rmfile() {
if [ -f $1 ]; then rm -f $1 ; fi
function rmdir() {
if [ -d $1 ]; then rm -fr $1; fi
rmfile CTestTestfile.cmake
rmfile install_manifest.txt
rmfile CMakeCache.txt
gubatron / quicksort.cpp
Created Feb 3, 2019
specific quick sort implementation in C++ for a struct based array
View quicksort.cpp
void quickSort(wordItem arr[], int length, bool reverse) {
if (length <= 1) {
const int pivot_count = arr[length / 2].count;
int smaller_length = 0;
int bigger_length = 0;
int equal_length = 0;
for (int i = 0; i < length; i++) {
gubatron /
Last active Nov 28, 2018
quick and dirty startSSHAgent bash function
function startSSHAgent {
if [[ -z "$SSH_AGENT_PID" ]]; then
echo "Starting fresh ssh agent"
eval `ssh-agent`
ssh-add ~/.ssh/my_private_key
ssh-add ~/.ssh/my_private_key_2
View parity tests benchmark.cpp
// g++ -std=c++11 parity_benchmark.cpp -o parity_benchmark
#include <iostream>
#include <chrono>
#include <functional>
std::int64_t now() {
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_\
gubatron / array_size.c
Last active Oct 18, 2018
Playing with arrays in C, getting the number of elements in an array, adding elements to an int "array" in dynamic memory manually with an int pointer.
View array_size.c
// gcc array_size.c -o array_size
#include <stdio.h> // printf
#include <stdlib.h> // malloc
int main() {
char arr[] = {'a','b','c','d','e'};
// this is how you can find out what the number of elements in an array is -> sizeof(theArray)/sizeof(any-element)
// here we print the count, and where the array is in memory. %p is used to print pointer addresses in printf.
printf("charArray.count -> %lu @ %p\n", sizeof(arr)/sizeof(arr[0]), &arr);
gubatron / CMakeList.txt
Last active Oct 18, 2018
CMakeList.txt for Bitcoin Unlimited + macOS CLion IDE based development
View CMakeList.txt
# Author: Angel Leon (@gubatron)
# October 2nd 2018
# This CmakeLists.txt file is not meant to produce any executables or libraries.
# It has been created for CLion or any other cmake compatible IDE users so that they can
gubatron / movePointer.cpp
Last active Oct 10, 2018
movePointer.cpp - on how arrays are passed to functions and how we can do something similar with pointers to them
View movePointer.cpp
// A short lesson on pointers and arrays in C++
// Author: Angel Leon - October 9th 2018
#include <iostream>
#include <string>
using namespace std;
int main() {
// define some string array with a few strings
string someArray[] = { "Nicole", "Leon", "Molina" };
gubatron /
Last active Jul 20, 2018
Java implementation of HTML highlighter. Replaces found query tokens in target strings for their HTML bolded version, keeping the original case of the token.
static String simpleHTMLHighlighter(String query, String str) {
if (query == null || query.isEmpty()) {
return str;
// Get unique tokens in the query
String[] rawTokens = query.split("\\s+");
HashSet<String> uniqueTokens = new HashSet<>();
for (String token : rawTokens) {
You can’t perform that action at this time.