(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| Function.prototype.runOnBackgroundThread = function (aCallback) { | |
| var _blob = new Blob(['onmessage = '+this.toString()],{"type":"text/javascript"}); | |
| var _worker = new Worker((webkitURL.createObjectURL || URL.createObjectURL)(_blob)); | |
| _worker.onmessage = aCallback; | |
| _worker.postMessage(); | |
| } | |
| var _test = function () { | |
| postMessage((1+1).toString()); | |
| } |
| ;; based on core.logic 0.8-alpha2 or core.logic master branch | |
| (ns sudoku | |
| (:refer-clojure :exclude [==]) | |
| (:use clojure.core.logic)) | |
| (defn get-square [rows x y] | |
| (for [x (range x (+ x 3)) | |
| y (range y (+ y 3))] | |
| (get-in rows [x y]))) |
| "hide passwords when editing (you can use select mode to see it), doesn't work | |
| "with all terminal types, but useful | |
| hi Password ctermfg=black ctermbg=black cterm=NONE guifg=black guibg=black | |
| match Password /pass.*\s*=\s*\k\{-}\zs[^ ]*\ze.\{-}/ |
| (ns datomic-helpers | |
| (:require [datomic.api :as d])) | |
| ;;; Expose Datomic vars here, for convenience | |
| ;;; Ring middleware | |
| (defn wrap-datomic | |
| "A Ring middleware that provides a request-consistent database connection and | |
| value for the life of a request." |
| //This sample is how to use websocket of Tomcat. | |
| package wsapp; | |
| import java.io.IOException; | |
| import java.nio.ByteBuffer; | |
| import java.nio.CharBuffer; | |
| import java.util.ArrayList; | |
| import org.apache.catalina.websocket.MessageInbound; | |
| import org.apache.catalina.websocket.StreamInbound; | |
| import org.apache.catalina.websocket.WebSocketServlet; |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
sudo mv /etc/zshenv /etc/zprofile~/.zprofile
| require 'action_dispatch/middleware/static' | |
| module Middleware | |
| class FileHandler < ActionDispatch::FileHandler | |
| def initialize(root, assets_path, cache_control) | |
| @assets_path = assets_path.chomp('/') + '/' | |
| super(root, cache_control) | |
| end | |
| def match?(path) |
| (defn uuid [] (str (java.util.UUID/randomUUID))) |