Skip to content

Instantly share code, notes, and snippets.

Ficus Kirkpatrick ficusk

Block or report user

Report or block ficusk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ficusk on github.
  • I am ficus (https://keybase.io/ficus) on keybase.
  • I have a public key whose fingerprint is B95D 503A ACA5 7ED7 FD5E 97E1 A494 F676 818C 1D4C

To claim this, I am signing this object:

@ficusk
ficusk / copypastefail.c
Created Feb 23, 2014
Braces don't prevent copy-paste bugs, kids.
View copypastefail.c
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) {
goto fail;
}
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
goto fail;
}
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) {
goto fail;
}
View LruBitmapCache.java
package your.awesome.app;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.toolbox.ImageLoader.ImageCache;
public class LruBitmapCache extends LruCache<String, Bitmap> implements ImageCache {
public LruBitmapCache(int maxSize) {
super(maxSize);
@ficusk
ficusk / GsonRequest.java
Last active Jun 4, 2019
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
View GsonRequest.java
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
You can’t perform that action at this time.