CURLOPT_DNS_CACHE_TIMEOUT: controls the TTL of a DNS cache entry. The default is 60s. Use -1 to keep the entry forever.CURLOPT_RESOLVE: pre-populate the DNS cache manually.CURLOPT_DNS_SERVERS: use alternate DNS servers (instead of system default ones). Warning: works only with c-ares (and it requires c-ares version >= 1.7.4),CURLOPT_DNS_USE_GLOBAL_CACHE: cache DNS queries between easy handles. Warning: this is not thread-safe and documented as deprecated. Use the share interface instead (see below).
| # place this in your fish path | |
| # ~/.config/fish/config.fish | |
| function fish_greeting | |
| if not type fortune > /dev/null 2>&1 | |
| apt-get install fortune | |
| end | |
| fortune -a | |
| end |
| BM25.Tokenize = function(text) { | |
| text = text | |
| .toLowerCase() | |
| .replace(/\W/g, ' ') | |
| .replace(/\s+/g, ' ') | |
| .trim() | |
| .split(' ') | |
| .map(function(a) { return stemmer(a); }); | |
| // Filter out stopStems |
| function flatMap($data, \Closure $p) | |
| { | |
| $collection = call_user_func_array("array_map", array($p)); | |
| return iterator_to_array(new \RecursiveIteratorIterator( | |
| new \RecursiveArrayIterator($data)), false); | |
| } |
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o
| .PHONY: build doc fmt lint run test vendor_clean vendor_get vendor_update vet | |
| # Prepend our _vendor directory to the system GOPATH | |
| # so that import path resolution will prioritize | |
| # our third party snapshots. | |
| GOPATH := ${PWD}/_vendor:${GOPATH} | |
| export GOPATH | |
| default: build |
The issue:
..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.
(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)
touch-action CSS property can be used to disable this behaviour.
touch-action: manipulationThe user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.
| <?php | |
| include 'minmaxheap.php'; | |
| /* A min-heap that will restrict itself to a maximum of some number of values. | |
| * Implemented internally as a min-max heap. | |
| * | |
| * Public API: | |
| * - Contructor takes a number, used as the maximum number of values allowed on the heap | |
| * - count() - returns the number of elements on the heap |
| Storage.prototype.get = function (key) { | |
| try { | |
| var result = JSON.parse(this.getItem(key)); | |
| if ((result !== null) && (result.hasOwnProperty('expiration') === true)) { | |
| if ((result.expiration >= (new Date())) || (result.expiration == null)) { | |
| return result.value || null; | |
| } | |
| this.removeItem(key); |