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
['cast#reset#running', () => | |
nextState('done/cancel') | |
.postpone()], |
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
['cast#done/:sessionId#running', ({data, args, event}) => | |
args.sessionId === data.sessionId | |
? nextState('done/done').data({response: {$set: event.extra}}) | |
: keepState()], |
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
['cast#done/:sessionId#running', ({data, args, event}) => | |
args.sessionId === data.sessionId | |
? nextState('done/done').data({response: {$set: event.extra}}) | |
: keepState()], |
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
['enter#*_#running', ({data}) => { | |
const res = keepState().emit('run', data) | |
return data.timeout ? res.stateTimeout(data.timeout) : res | |
}], |
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
['cast#start#idle', ({event}) => | |
nextState('running') | |
.data({request: {$set: event.extra}})], |
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
['enter#*_#idle', () => keepState() | |
.emit('init') | |
.data({ | |
errors: {$set: []}, | |
response: {$set: null}, | |
sessionId: {$set: uniqid()} | |
})], |
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
/** | |
* For a fixed sized array, adds item to the end of | |
* an array and drops elements from the front, if needed | |
* | |
* @param item {T}- to be added to the end of the array | |
* @param arr {T[]} - the array | |
* @param size {number} - Max size of the array. | |
* @return {T[]} The updated array | |
*/ | |
function pushFixed<T>(item: T, arr: Array<T>, size: number): Array<T> { |
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
html .system-font-stack { | |
font-weight: 200 !important; | |
font-family: "mplus-1c-light" !important; | |
font-size: 12px !important; | |
color: #748FB4 !important; | |
} | |
.js-app .js-column .stream-item .js-tweet-text { | |
color: #748FB4 !important; | |
} |
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 MovingAverageWithRate(object): | |
""" | |
Computes the moving average (with optional sample rate) of supplied | |
samples over a given window size. | |
Add new samples with add() | |
""" | |
def __init__(self, window_size): |
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
object IterableExtSpec : Spek({ | |
val list = (0 until 100).toList() | |
describe("splitAt") { | |
it("asserts when n < 0") { | |
assertFailsWith<IllegalArgumentException> { | |
list.splitAt(-2) | |
} | |
} |