Skip to content

Instantly share code, notes, and snippets.

View typelogic's full-sized avatar
🏹

typelogic typelogic

🏹
View GitHub Profile
Publish AAR to jCenter and Maven Central
=================
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](http://twitter.com/lopezmikhael)
Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:
1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: [CircularImageView](https://github.com/lopspower/CircularImageView)
2. In the library folder(module) I have the lib code abovementioned. And applying in the build.gradle of this folder `apply plugin: 'com.android.library'` I got as output an .aar in the build/outputs/aar/ directory of the module's directory
@typelogic
typelogic / python_xml_xsd.md
Created November 11, 2020 02:51
python xml/xsd validation

validator.py:

from lxml import etree
import sys,os

def validate(xml_path: str, xsd_path: str) -> bool:

    xmlschema_doc = etree.parse(xsd_path)
    xmlschema = etree.XMLSchema(xmlschema_doc)
@typelogic
typelogic / gradlesigning.md
Created November 9, 2020 07:58 — forked from phit/gradlesigning.md
Gradle Signing for Dummies

Setup

Windows

Download the GnuPG binary release for windows current version from the official site and install it.

Linux

Grab the latest gpg from your package manager if it's not installed already anyway ;)

@typelogic
typelogic / gist:93c06f6487b5fe5dc781cbe8313bf9eb
Created November 9, 2020 05:09
Dependencies: maven, gradle
https://github.com/terl/lazysodium-java/issues/60
@typelogic
typelogic / pom.xml
Created November 5, 2020 10:00
Java version switching
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eigenfield</groupId>
<artifactId>mylib</artifactId>
<version>1.0-SNAPSHOT</version>
#!/bin/bash
# This script requires jq, a command line to to parse and format JSon.
# https://stedolan.github.io/jq/
function padBase64 {
STR=$1
MOD=$((${#STR}%4))
if [ $MOD -eq 1 ]; then
STR="${STR}="
@typelogic
typelogic / README.md
Created October 19, 2020 15:42 — forked from joyrexus/README.md
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

@typelogic
typelogic / xml.tips
Last active October 7, 2020 14:53
xmlstarlet tips
xmlstarlet sel -N x="http://standards.iso.org/iso-iec/19785/-3/ed-2/" -t -v "count(//x:BDB)" /tmp/x.xml
xmlstarlet sel -N x="http://standards.iso.org/iso-iec/19785/-3/ed-2/" -t -m "//x:BDBInfo" -v "x:Type" -n /tmp/x.xml
xmlstarlet sel -N x="http://standards.iso.org/iso-iec/19785/-3/ed-2/" -t -c "//x:BDBInfo[x:Type='Face']/../x:BDB" -n /tmp/x.xml
xmlstarlet sel -N x="http://standards.iso.org/iso-iec/19785/-3/ed-2/" -t -v "//x:BDBInfo[x:Type='Face']/../x:BDB" /tmp/x.xml
@typelogic
typelogic / j.nix
Created October 3, 2020 12:48
nix maven
{ pkgs ? import <nixpkgs> {} }:
let x = pkgs.maven.override {
jdk = pkgs.jdk11;
};
in pkgs.mkShell {
buildInputs = [ x ];
}
https://i.imgur.com/Qyo0Xj6.png