Instantly share code, notes, and snippets.

View percentToHex.sh
#!/bin/bash
# Usage: ./percentToHex <percentValue>
# Examples:
# ./percentToHex 97.5
# ./percentToHex 78
num="$1 * .01000 * 255" # note: extra zeros for better precision
num=`echo "$num" | bc`
num=`echo "$num" | python -c "print(\"{:.0f}\".format(round(float(raw_input()))))"`
echo "obase=16; $num" | bc
View HighQualityImageLoader.java
package com.example.volley;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import com.android.volley.RequestQueue;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.toolbox.ImageCache;
import com.android.volley.toolbox.ImageLoader;
View DoubleMeasureRelativeLayout.java
/*
* Copyright (C) 2013 Scott Weber
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ExpandingCircleAnimationDrawable.java
package com.example.manualanimation;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.view.animation.AnimationUtils;