start new:
tmux
start new with session name:
tmux new -s myname
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Orange struct { | |
| } | |
| /* this will not work, as the NewOrange return concrete as interface, which is not addressable |
| version: '3' | |
| services: | |
| zookeeper: | |
| image: wurstmeister/zookeeper | |
| ports: | |
| - "2181:2181" | |
| kafka: | |
| image: wurstmeister/kafka:1.0.1 | |
| ports: | |
| - 9092:9092 |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| // Suggestions from golang-nuts | |
| // http://play.golang.org/p/Ctg3_AQisl |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| function tunkfiedSettimeOut(delay,index) { | |
| return function(cb) { | |
| console.log('index: ',index); | |
| setTimeout(function(){ | |
| cb(undefined,delay); | |
| },delay); | |
| } | |
| } | |
| tunkfiedSettimeOut(3000,1)(function(err,data){console.log("delay is", data)}); |
| find . -type f -name *.flac -exec rm {} \; |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <style> | |
| body { | |
| background-color: #f1f4f9; | |
| padding: 50px; |
| function JSONOnly(req, res, next) { | |
| console.log(req.header('accept')); | |
| console.log(req.is('json')); | |
| if (!req.is('json')) { | |
| res.send(406); | |
| } | |
| else { | |
| next(); | |
| } |