Skip to content

Instantly share code, notes, and snippets.

@bryanjhv
bryanjhv / README.md
Created May 5, 2019 06:40
Script to copy apps between android devices.

Installation

cd
mkdir -p apks
wget https://gist.githubusercontent.com/bryanjhv/f5b19a3622b8f1a2f9bcb31c315c3014/raw/copy.sh -O apks/copy
chmod +x apks/copy

Usage

XSD TO JAVA

Simple proof of concept for converting XSD schemas into pure Java classes at runtime and by using reflection. It can be improved to, for example, build intelligent JAX-RS console or GUI clients without knowledge of the domain model, by querying application.wadl and looking for the schema. The classes are transpiled, compiled and appended to the path at runtime so they are always updated. Other things missing is fetching the schema from network instead of a file, not depending on JXC and Javax Tools, building a schema and creating an automatic CLI client for it, between other tree of possibilities.

@bryanjhv
bryanjhv / README.md
Last active June 19, 2023 19:51
Spotify song recorder for Linux (tested with Arch/Manjaro).

Spotify recorder

Simple Python script which uses DBus + ALSA to record current Spotify song.

Setup

First, you need a graphical desktop environment.
The setup.sh should be enough for Arch-based distro.
You need Spotify API credentials, find out how to get them.

@bryanjhv
bryanjhv / private.php
Created November 7, 2016 23:30
Get private variable of object in PHP 5.3+
<?php
/**
* Get a private variable from any object.
*
* @param mixed $obj
* @param string $name
* @return mixed
*/
function get_private_var($obj, $name) {
#--
# MAIN MODULE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#++
module Simplex
#--
# UTILITIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#++
module Util