Skip to content

Instantly share code, notes, and snippets.

@who
who / dexcount
Created Apr 24, 2015
Counts methods in a jar. Useful for testing to see if a jar is going to contribute to the 65K method limit in Android
View dexcount
#!/bin/bash
if [ ! -e `which dx` ]
then
echo "Please make sure the dx executable (from android-sdk build-tools) is in your $PATH"
exit 1
fi
tmpFolder=$(mktemp -d /tmp/tmp.XXXXXXXX);
dx --dex --output=$tmpFolder/temp.dex $1 >> /dev/null 2>&1
cat $tmpFolder/temp.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
View multiple-protocol-spec.json
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"schemes": [
"http",
"https"
],
View http-protocol-spec.json
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"schemes": [
"https"
],
"paths": {
View big_spec.json
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Big API"
},
"schemes": [
"http",
"https"
],
View big_api.yml
swagger: "2.0"
info:
version: 0.0.0
title: Big API
schemes:
- http
- https
paths:
/79d7645d47554205bb48b1ef2562b2ef:
get:
View strange_body_param_settings
swagger: "2.0"
info:
version: 0.0.0
title: An API
paths:
"/testing/{testString}":
post:
parameters:
- name: testString
in: path
View duplicate_operationIds
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"paths": {
"/": {
"get": {
"operationId": "unoriginalOperationId",
View gist:e53a0fff078e6bb26e8c

This method ...

    @POST
    @Path("/strings")
    @ApiOperation(value = "Send a string in the body",
        nickname = "gimmieString",
        authorizations = @Authorization(value = "basicAuth"))
    public String gimmieString(@ApiParam("theString") String theString, @Auth User user) {
        return "you sent: "+ theString;
View svn_revision_mapper.sh
#!/bin/bash
TMP=$(mktemp /tmp/svn_revisions_XXXXXXXXXXXX.csv);
echo "Processing ...";
echo "PATH,REVISION" > $TMP;
for svndir in $(find . -name .svn)
do
PARENTDIR=$(dirname $svndir);
View extra-slash-repro.json
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"host":"api.example.com",
"paths": {
"/api": {
"get": {