Skip to content

Instantly share code, notes, and snippets.

public static InputStream readFromCacheSync(String imageUrl) {
CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(ImageRequest.fromUri(imageUrl), null);
StagingArea stagingArea = StagingArea.getInstance();
EncodedImage encodedImage = stagingArea.get(cacheKey);
if (encodedImage != null) {
return encodedImage.getInputStream();
}
try {
return readFromDiskCache(cacheKey);
@atma
atma / nginx-osx-install.sh
Last active July 30, 2017 02:38
Mac OS X nginx installation from source
# download PCRE and nginx source
sudo mkdir -p /usr/local/src
cd /usr/local/src
# copy PCRE to directory
# eg. cp /tmp/pcre-8.20.tar.gz /usr/local/src/
tar xzvf pcre-8.20.tar.gz
cd pcre-8.20
./configure --prefix=/usr/local
make && sudo make install && make clean
@atma
atma / dabblet.css
Created December 7, 2013 15:26 — forked from LeaVerou/dabblet.css
(C)Leanest CSS spinner ever
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;