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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get a private variable from any object. | |
* | |
* @param mixed $obj | |
* @param string $name | |
* @return mixed | |
*/ | |
function get_private_var($obj, $name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- | |
# MAIN MODULE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
#++ | |
module Simplex | |
#-- | |
# UTILITIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
#++ | |
module Util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
ifaces=($(ip link | grep '^[0-9]' | cut -d: -f2 | sed '1d;s/ //')) | |
iface=${ifaces[0]} | |
if [ $# -gt 0 ]; then | |
found=0 | |
for i in ${ifaces[@]}; do | |
if [ $1 == $i ]; then | |
found=1 | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import java.util.HashMap; | |
import java.util.Base64; | |
import java.util.Map.Entry; | |
import javax.crypto.Cipher; | |
import javax.crypto.SecretKey; | |
import java.io.FileInputStream; | |
import java.io.ObjectInputStream; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; |
-
After installing mitmproxy run it (just type
mitmproxy
) in a terminal session and quit. This will create the necessaries certificates files at~/.mitmproxy
. -
Extract the certificate to
.crt
format:
openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt
-
Trust the certificate into CA:
sudo trust anchor ca.crt
-
Run the
mitmproxy
again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x | |
mkdir -p src usr | |
# Set variables | |
export PREFIX=$PWD/usr | |
export HOST_TAG=linux-x86_64 | |
export NDK=$HOME/Android/Sdk/ndk-bundle | |
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG | |
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar | |
export AS=$TOOLCHAIN/bin/arm-linux-androideabi-as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from smbus import SMBus | |
SSD1306_ADDRESS = 0x3C | |
SSD1306_MEMORYMODE = 0x20 | |
SSD1306_COLUMNADDR = 0x21 | |
SSD1306_PAGEADDR = 0x22 | |
SSD1306_SETCONTRAST = 0x81 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ $# -lt 2 ]]; then | |
echo "ERR: Missing arguments." | |
# requires an SSH server | |
# arg1: {package}.{extension}@{version} | |
# arg2 {host} | |
exit 1 | |
fi |
OlderNewer