Add lodash, rack-test
This commit is contained in:
parent
8a3ba8d402
commit
b40e7629b1
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
title: Lodash
|
||||||
|
---
|
||||||
|
|
||||||
|
> This is an incomplete list.
|
||||||
|
|
||||||
|
### Array
|
||||||
|
|
||||||
|
```js
|
||||||
|
_.chunk([ abcd ], 2) //=> [ [ab], [cd] ]
|
||||||
|
_.compact(list)
|
||||||
|
|
||||||
|
_.difference([ abc ], [ bc ]) //=> [ a ]
|
||||||
|
_.intersection()
|
||||||
|
|
||||||
|
_.drop([ abcde ], 1) //=> [ bcde ] (right)
|
||||||
|
_.dropWhile
|
||||||
|
|
||||||
|
_.dropRight
|
||||||
|
_.dropRightWhile
|
||||||
|
|
||||||
|
_.fill(Array(4), 'x') //=> [ 'x', 'x', 'x', 'x' ]
|
||||||
|
|
||||||
|
_.findIndex
|
||||||
|
_.findLastIndex
|
||||||
|
|
||||||
|
_.flatten
|
||||||
|
_.flattenDeep
|
||||||
|
|
||||||
|
_.indexOf(list, val)
|
||||||
|
```
|
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
title: Rack-test
|
||||||
|
---
|
||||||
|
|
||||||
|
```rb
|
||||||
|
get 'url'
|
||||||
|
post 'url', 'name' => 'john'
|
||||||
|
put
|
||||||
|
patch
|
||||||
|
delete
|
||||||
|
options
|
||||||
|
head
|
||||||
|
|
||||||
|
authorize 'user', 'pass'
|
||||||
|
env 'rack.session', csrf: 'token'
|
||||||
|
header 'Content-Type', 'text/html'
|
||||||
|
```
|
||||||
|
|
||||||
|
See [rack/test.rb](https://github.com/brynary/rack-test/blob/master/lib/rack/test.rb).
|
Loading…
Reference in New Issue