- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
- edit /etc/redis-xxx.conf, illustrated as below
...
// | |
// AppDelegate.swift | |
// pushtest | |
// | |
// Created by sawapi on 2014/06/08. | |
// Copyright (c) 2014年 sawapi. All rights reserved. | |
// | |
// iOS8用 | |
import UIKit |
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
// Find this cell's album by passing in the indexPath.row to the subscript method for an array of type Album[] | |
let album = self.albums[indexPath.row] | |
cell.text = album.title | |
cell.image = UIImage(named: "Blank52") | |
cell.detailTextLabel.text = album.price | |
import Foundation | |
import UIKit | |
import Webkit | |
class BasicChildBrowser:UIViewController, WKNavigationDelegate { | |
let web = WKWebView() | |
let toolbar = UIToolbar() | |
let progressSpinner = UIActivityIndicatorView(activityIndicatorStyle: .White) | |
let progressBar = UIProgressView(progressViewStyle: .Bar) |
$ cp /etc/redis.conf /etc/redis-xxx.conf
...
// for detailed comments and demo, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381 | |
/* a helper to execute an IF statement with any expression | |
USAGE: | |
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes | |
-- to access any global function or property you should use window.functionName() instead of just functionName() | |
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later | |
<p> | |
{{#xif " name == 'Sam' && age === '12' " }} | |
BOOM |
server { | |
server_name $domain_name; | |
root /var/www; | |
index index.html index.php; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
# Cache static files for as long as possible | |
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { | |
try_files $uri =404; |
also known as table soccer, foosball, fussball
A Pen by Dan Stuart on CodePen.
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
addEventListener( | |
'scroll', | |
function() { | |
var i, | |
img, | |
rect, | |
images = document.querySelectorAll('[lazyload-src]'); | |
if ( ! images.length ) { | |
return; |