(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
{-# LANGUAGE RecursiveDo, ScopedTypeVariables, FlexibleContexts #-} | |
import Reflex.Dom | |
import Data.Monoid | |
import Control.Monad | |
import Data.Map (Map) | |
import qualified Data.Map as Map | |
insertNew_ :: (Enum k, Ord k) => v -> Map k v -> Map k v | |
insertNew_ v m = case Map.maxViewWithKey m of |
import Reflex.Dom | |
import Data.Monoid | |
main :: IO () | |
main = mainWidgetWithHead headWidget bodyWidget | |
headWidget = do | |
elAttr "link" ("href" =: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" <> "rel" =: "stylesheet" <> "type" =: "text/css") $ return () | |
bodyWidget = do |
This is now part of craft-scripts: | |
https://github.com/nystudio107/craft-scripts |
class Webkitgtk24 < Formula | |
desc "Full-featured Gtk+ port of the WebKit rendering engine" | |
homepage "http://webkitgtk.org" | |
url "http://webkitgtk.org/releases/webkitgtk-2.4.9.tar.xz" | |
sha256 "afdf29e7828816cad0be2604cf19421e96d96bf493987328ffc8813bb20ac564" | |
needs :cxx11 | |
# I would get ghc compilation errors from webkitgtk if video was not enabled | |
# so this is kind pointless? maybe useful for other project, but I need it |
This pretty much explains it: http://crypto.stanford.edu/~blynn/haskell/foldl.html here I just review the article.
The rule of thumb is this:
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |