This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MockRequestHandler extends RequestHandler { | |
private GetMethod mockGetMethod; | |
private HttpClient mockHttpClient; | |
public MockRequestHandler(int responseStatus, | |
byte[] responseBody) throws HttpException, IOException, | |
SecurityException, IllegalArgumentException, | |
NoSuchMethodException, IllegalAccessException, | |
InvocationTargetException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HEAD=origin | |
if [ -n "$1" ]; then | |
HEAD=$1 | |
fi | |
CURRENT_IFS=$IFS | |
IFS=$'\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@flow | |
type Props = { | |
name: string | |
} | |
type MyRecord = RecordOf<Props> | |
type MyMap = Map<MyRecord,List<number>> | |
const create: MyRecordFactory<Props> = Record({name:""}); | |
const myMap = Map().set(create({name:"hi"}), List([1]) ) | |
//example 1 | |
const arr = Seq(myMap.entries()).reduce( (list, map) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const {Map, List} = require("immutable") | |
const list = List( | |
["archives", | |
"archives/arts", | |
"archives/history" ]) | |
const tree = list.reduce( (map, it) => map.setIn( it.split( "/" ), Map() ), Map() ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const {List, Record} = require("immutable") | |
class Foo extends Record({ list: List() }) { | |
constructor( props ) { | |
const inst = super( props ) | |
const list = inst.get( "list" ) | |
if( list instanceof Array ) { | |
return inst.set( "list", List( list ) ) | |
} | |
if( !List.isList( list ) ) { throw new Error ( "List member should be type List, or Array" ) } |