Skip to content

Instantly share code, notes, and snippets.

View robbinhan's full-sized avatar
🏠
Working from home

robbin han robbinhan

🏠
Working from home
View GitHub Profile
package app
import (
"bytes"
"encoding/json"
"ethereum-benchmark/config"
"fmt"
"io/ioutil"
"log"
"net/http"
@robbinhan
robbinhan / how-to-delete-lines-containing-a-given-string.md
Created February 1, 2017 07:50 — forked from nepsilon/how-to-delete-lines-containing-a-given-string.md
How to delete lines containing a given string? — First published in fullweb.io issue #85

How to delete lines containing a given string?

Just like last week, where we wanted to replace a string, we can use sed for this task:

sed '/pouet/d' file.txt

This will output file.txt on stdout without the lines containing pouet.

@robbinhan
robbinhan / seajs.js
Created August 16, 2016 03:38
个人对seajs的分析
/**
* 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}}}`
@robbinhan
robbinhan / pointEqual.js
Last active May 3, 2020 11:38
|-|{"files":{"pointEqual.js":{"env":"js","abbr":"`pe"}},"tag":"Uncategorized"}
function pointEqual(a,b)
{
var e = 1e-6;
return Math.abs(a-b) < e
}
@robbinhan
robbinhan / introrx.md
Created December 15, 2015 05:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@robbinhan
robbinhan / mersenne-twister.js
Created November 24, 2015 05:30 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
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();
@robbinhan
robbinhan / tmux-cheatsheet.markdown
Created October 23, 2015 07:24 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@robbinhan
robbinhan / css.css
Created October 4, 2015 08:57
flex布局,左右固定,中间自适应
.demo{
/*flex布局(作用于容器)*/
display: flex;
/*项目拉伸对齐,也就是所左边的高度为拉伸到和右边底部对齐*/
align-items: flex-end;
}
.demo .left{
/*左边固定宽度,必须设置其最小宽度和最大宽度*/
@robbinhan
robbinhan / new_gist_file.css
Last active January 3, 2020 09:00
flex布局左边固定,右边自适应
.demo{
/*flex布局(作用于容器)*/
display: flex;
/*项目拉伸对齐,也就是所左边的高度为拉伸到和右边等高,默认是拉伸的*/
/*align-items: stretch;*/
}
.demo .left{
/*左边固定宽度,必须设置其最小宽度和最大宽度*/