This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var express = require('express'); | |
process.on('uncaughtException', function(err) { | |
console.log( " UNCAUGHT EXCEPTION " ); | |
console.log( "[Inside 'uncaughtException' event] " + err.stack || err.message ); | |
}); | |
anHTTPServer = express.createServer(function (req,res){ | |
if (Math.random() > 0.9) throw new Error('fail!'); | |
res.send("Hello World : Express!!"); | |
}); |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title> | |
<style> | |
body { | |
background: white; | |
text-align: center; |
(* ocamlfind c -w A -linkpkg -package lwt,lwt.unix,lwt.syntax -syntax camlp4o,lwt.syntax myecho.ml -o myecho *) | |
(* This code refers to https://github.com/avsm/ocaml-cohttpserver/blob/master/server/http_tcp_server.ml *) | |
open Lwt | |
let server_port = 12345 | |
let so_timeout = Some 20 | |
let backlog = 10 | |
let try_close chan = | |
catch (fun () -> Lwt_io.close chan) |
/* iOS Native App Default Style implemented in CSS */ | |
/* Bootstrapping … */ | |
* { | |
margin: 0; | |
padding: 0; | |
font-size: inherit; | |
-webkit-tap-highlight-color: rgba(0,0,0,0); | |
} |
set -g default-terminal "screen-256color" | |
set -g status-utf8 on | |
bind M source-file ~/.tmux/mac.session | |
bind L source-file ~/.tmux/linux.session | |
# set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# THEME | |
set -g status-bg black |
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/1868955 | |
* | |
* This mixin now has its own github repository: https://github.com/kurtmilam/underscoreDeepExtend | |
* It's also available through npm and bower | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFR |
/************************************/ | |
基本命令 | |
C-x C-f 打开/新建文件 | |
C-x C-s 保存当前缓冲区 | |
C-x C-w 当前缓冲区另存为 | |
C-x C-v 关闭当前Buffer并打开新文件 | |
C-x i 光标处插入文件 | |
C-x b 切换Buffer | |
C-x C-b 显示Buffer列表 | |
C-x k 关闭当前Buffer |
Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.
We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.