注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
source :rubygems | |
gem 'sinatra' |
# -*- coding: utf-8 -*- | |
require 'sinatra/base' | |
require 'pp' | |
require 'webrick' | |
require 'webrick/https' | |
require 'openssl' | |
CRT_FILE_NAME = 'server.crt' | |
RSA_FILE_NAME = 'server.key' |
(defun eshell-mode-hook-func () | |
(setq eshell-path-env (concat "/usr/local/bin:" eshell-path-env)) | |
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH"))) | |
(define-key eshell-mode-map (kbd "M-s") 'other-window-or-split)) | |
(add-hook 'eshell-mode-hook 'eshell-mode-hook-func) |
package eval | |
import scala.reflect.runtime.currentMirror | |
import scala.tools.reflect.ToolBox | |
import java.io.File | |
object Eval { | |
def apply[A](string: String): A = { | |
val toolbox = currentMirror.mkToolBox() |
# Homepage (Root path) | |
enable :sessions | |
helpers do | |
def current_user | |
begin | |
@current_user = User.find(session["user_id"].to_i) | |
# @current_user = User.find(response.cookies["user_id"].to_i) | |
rescue | |
@current_user = nil |
import java.io.{ByteArrayOutputStream, ByteArrayInputStream} | |
import java.util.zip.{GZIPOutputStream, GZIPInputStream} | |
import scala.util.Try | |
object Gzip { | |
def compress(input: Array[Byte]): Array[Byte] = { | |
val bos = new ByteArrayOutputStream(input.length) | |
val gzip = new GZIPOutputStream(bos) |
jit-toy: jit-toy.cpp | |
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core) |
#pragma once | |
#include "pico/stdlib.h" | |
#include "pico/binary_info.h" | |
#include "hardware/flash.h" | |
#include "hardware/sync.h" | |
#include <lfs.h> |