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.
| // ==UserScript== | |
| // @name Slack: Always Stay Active | |
| // @namespace https://ericdraken.com/slack-always-stay-active | |
| // @version 1.0.4c | |
| // @description Always stay active on Slack. | |
| // @author Eric Draken (ericdraken.com), THOUSAND-SKY, pannal | |
| // @match https://app.slack.com/client/* | |
| // @icon https://www.google.com/s2/favicons?domain=slack.com | |
| // @grant unsafeWindow | |
| // @run-at document-start |
| 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.offsetParentI'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' | |
| } |