Just like last week, where we wanted to replace a string, we can use sed for this task:
sed '/pouet/d' file.txtThis will output file.txt on stdout without the lines containing pouet.
| package app | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "ethereum-benchmark/config" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
| /** | |
| * Sea.js 3.0.1 | seajs.org/LICENSE.md | |
| */ | |
| (function(global, undefined) { | |
| // Avoid conflicting when `sea.js` is loaded multiple times | |
| if (global.seajs) { | |
| return | |
| } | |
| //创建seajs对象 |
| 'use strict' | |
| let html = "<title>{{title}}</title><div>{{content}}</div><div>{{content}}</div><div>{{content}}</div><div>{{content}}</div>" | |
| const data = { | |
| title:"Test", | |
| content:"Hello World" | |
| } | |
| for(let k in data) { | |
| let v = data[k] | |
| let patten = `{{${k}}}` |
| function pointEqual(a,b) | |
| { | |
| var e = 1e-6; | |
| return Math.abs(a-b) < e | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
| so it's better encapsulated. Now you can have multiple random number generators | |
| and they won't stomp all over eachother's state. | |
| If you want to use this as a substitute for Math.random(), use the random() | |
| method like so: | |
| var m = new MersenneTwister(); |
| .demo{ | |
| /*flex布局(作用于容器)*/ | |
| display: flex; | |
| /*项目拉伸对齐,也就是所左边的高度为拉伸到和右边底部对齐*/ | |
| align-items: flex-end; | |
| } | |
| .demo .left{ | |
| /*左边固定宽度,必须设置其最小宽度和最大宽度*/ |
| .demo{ | |
| /*flex布局(作用于容器)*/ | |
| display: flex; | |
| /*项目拉伸对齐,也就是所左边的高度为拉伸到和右边等高,默认是拉伸的*/ | |
| /*align-items: stretch;*/ | |
| } | |
| .demo .left{ | |
| /*左边固定宽度,必须设置其最小宽度和最大宽度*/ |