Suppose you have weird taste and you absolutely want:
- your visual selection to always have a green background and black foreground,
- your active statusline to always have a white background and red foreground,
- your very own deep blue background.
module Genetic exposing (Config, Goal(..), run) | |
import List.Extra as List | |
import Random exposing (Generator) | |
import Random.Extra as Random | |
import Random.List | |
type alias Config solution = | |
{ newSolution : Generator solution |
Suppose you have weird taste and you absolutely want:
module Application | |
module Controllers | |
class MyController < Sinatra::Base | |
helpers Sinatra::Streaming | |
class << self | |
def stream(method, path, opts = {}, &block) | |
send(method, path, opts) do | |
stream do |out| | |
timer = EventMachine::PeriodicTimer.new(10) { out << "\0" } |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
#!/bin/bash | |
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz" | |
tar -xf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure | |
make | |
make verify | |
sudo make install | |
sudo ldconfig |
threads 1, 4 | |
workers 2 | |
preload_app! | |
environment 'development' | |
bind 'tcp://0.0.0.0:3000' | |
ssl_bind '127.0.0.1', '5002', { | |
key: 'doc/certs/server.key', | |
cert: 'doc/certs/server.crt' | |
} |
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |