This is what happens when I try to pick a language.
Note: If I didn't think it was possible to create a development environment without any of these issues (which I consider "major" for the most part), I would not have written this list.
- NOTHNX.
set softtabstop=2 | |
set shiftwidth=2 | |
set tabstop=2 | |
set expandtab "expandtab (whitespace) | |
set number "line numbers | |
set ai "autoindent | |
set si "smartindent | |
set tw=79 "wrap on 79 | |
set sta "smarttab | |
set history=100 "remember more than 20 cmd-history |
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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms | |
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory |
class Lisp | |
def initialize | |
@env = { | |
:label => lambda { |(name,val), _| @env[name] = val }, | |
:quote => lambda { |sexpr, _| sexpr[0] }, | |
:car => lambda { |(list), _| list[0] }, | |
:cdr => lambda { |(list), _| list.drop 1 }, | |
:cons => lambda { |(e,cell), _| [e] + cell }, | |
:eq => lambda { |(l,r), _| l == r }, | |
:if => lambda { |(cond, thn, els), ctx| eval(cond, ctx) ? eval(thn, ctx) : eval(els, ctx) }, |
This is what happens when I try to pick a language.
Note: If I didn't think it was possible to create a development environment without any of these issues (which I consider "major" for the most part), I would not have written this list.
// to build: | |
// lessc <filename> > site.css | |
// lessc <filename> > site.min.css --compress | |
// the swatch | |
@color1: #55626b; | |
@color2: #6c9380; | |
@color3: #c1ca55; | |
@color4: #f07d6b; | |
@color5: #ad5472; |
1. 虚拟IP。我一般用来linux和虚拟机之间共享用的,因为考虑到linux宿主机的ip是动态ip会变化。我所见到的实际用途是负载均衡。 | |
sudo ifconfig eth1:0 125.12.12.77 | |
2. windows根据 ip查看主机名,公司内部主机名一般会是ALIBABA-XXXXX,XXXXX就是工号,这样就可以找到对应的人,当然如果是隔日的,需要考虑动态IP的问题。 | |
nbtstat -a IP | |
3. awk |
##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
Talk as a screencast: http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
#!/usr/bin/env node | |
// requires node v0.3 | |
// telnet.js 80 google.com | |
net = require('net'); | |
a = process.argv.slice(2); | |
if (!a.length) { | |
console.error("telnet.js port [ host=localhost ]"); | |
process.exit(1); | |
} | |
s = require('net').Stream(); |
TarGZ = function(){}; | |
// Load and parse archive, calls onload after loading all files. | |
TarGZ.load = function(url, onload, onstream, onerror) { | |
var o = new TarGZ(); | |
o.onload = onload; | |
o.onerror = onerror; | |
o.onstream = onstream; | |
o.load(url); | |
return o; |
#!/bin/sh -e | |
# | |
# Usage: browser | |
# pipe html to a browser | |
# e.g. | |
# $ echo '<h1>hi mom!</h1>' | browser | |
# $ ron -5 man/rip.5.ron | browser | |
if [ -t 0 ]; then | |
if [ -n "$1" ]; then |