This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#clean all containers: | |
docker ps -a | sed '1 d' | awk '{print $1}' | xargs -L1 docker rm | |
#clean all images: | |
docker images -a | sed '1 d' | awk '{print $3}' | xargs -L1 docker rmi -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Woff font loader with localStorage caching | |
function loadFont(a, b, c, d) { function e() { if (!window.FontFace) return !1; var a = new FontFace("t", 'url("data:application/font-woff2,") format("woff2")', {}), b = a.load(); try { b.then(null, function () { }) } catch (c) { } return "loading" === a.status } var f = navigator.userAgent, g = !window.addEventListener || f.match(/(Android (2|3|4.0|4.1|4.2|4.3))|(Opera (Mini|Mobi))/) && !f.match(/Chrome/); if (!g) { var h = {}; try { h = localStorage || {} } catch (i) { } var j = "x-font-" + a, k = j + "url", l = j + "css", m = h[k], n = h[l], o = document.createElement("style"); if (o.rel = "stylesheet", document.head.appendChild(o), !n || m !== b && m !== c) { var p = c && e() ? c : b, q = new XMLHttpRequest; q.open("GET", p), q.onload = function () { q.status >= 200 && q.status < 400 && (h[k] = p, h[l] = q.responseText, d || (o.textContent = q.responseText)) }, q.send() } else o.textContent = n } }; | |
//loadFont('Lato400', '/assets/fonts/lato/lato.woff.css', '/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery AJAX errors handler | |
$(document).ajaxError(function (event, request, settings) { | |
ga( | |
'send', | |
'event', | |
'jQuery Ajax Error', | |
settings.url, | |
JSON.stringify({ | |
result: event.result, | |
status: request.status, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listen 443 ssl spdy; | |
ssl on; | |
ssl_protocols TLSv1.2 TLSv1.1 TLSv1; | |
ssl_session_cache shared:SSL:20m; | |
ssl_session_timeout 10m; | |
ssl_ciphers 'EECDH+ECDSA+AESGCM:AES128+EECDH:AES128+EDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!CAMELLIA:!ADH'; | |
ssl_prefer_server_ciphers on; | |
resolver 8.8.8.8 8.8.4.4 valid=300s; | |
resolver_timeout 10s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Call immediately an experiment method to prevent a FOOC (Flash of original content) --> | |
<button class="btn btn-link" type="button" id="button">Click me</button> | |
<script>typeof __abt !== "undefined" && __abt.some && __abt.some();</script> | |
<div classs="another-html-content"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
function addFont() { | |
var style = document.createElement('style'); | |
style.rel = 'stylesheet'; | |
document.head.appendChild(style); | |
style.textContent = localStorage.sourceSansPro; | |
} | |
try { | |
if (localStorage.sourceSansPro) { |
NewerOlder