Skip to content

Instantly share code, notes, and snippets.

View dafi's full-sized avatar

Davide Ficano dafi

View GitHub Profile
@dafi
dafi / OverviewResource.java
Created May 29, 2018 04:20 — forked from wonderb0lt/OverviewResource.java
A JAX-RS resource that shows all bound methods in the current context (RestEasy only)
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@dafi
dafi / TopCropImageView.java
Created May 6, 2017 13:13 — forked from arriolac/TopCropImageView.java
Custom Android ImageView for top-crop scaling of the contained drawable.
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@dafi
dafi / 0_reuse_code.js
Created November 18, 2013 13:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console