var _pnq = _pnq || [];
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
import { ObserveObjectPath, Keypath } from 'observe-object-path'; | |
import { Observable, CompositeDisposable } from 'rx'; | |
import React, { Component, ComponentClass } from 'react'; | |
import store from '../store.ts'; | |
type KeypathMap = { [key: string]: Keypath }; | |
type ObservableMap = { [key: string]: Observable<any> }; | |
const oop = new ObserveObjectPath(store.getState()); |
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
# Get browserstack supported browsers | |
curl -u "<username>:<automate-key>" https://api.browserstack.com/4/browsers.json |
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
# Open a new Chrome window with a specific user profile | |
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --profile-directory='Profile 4' |
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
var someProps = { | |
propA: { | |
id: 123, | |
}, | |
// propB: {}, no available now | |
}; | |
<ObjectExplore explore={someProps}> | |
<Path lookFor='propA' renderComponent={ComponentA} /> // ComponentA will have access to {id: 123} when instantiated | |
<Path lookFor='propB' renderComponent={ComponentB} /> // Won't get rendered since 'propB' is not available |
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
import { Component } from 'React'; | |
class MyComponent extends Component { | |
render() { | |
return ( | |
<div className='container'><div className='box'>the box</div></div> | |
); | |
} | |
} |
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
var funcA = Bluebird.coroutine(function *() { | |
while (true) { | |
yield someFunction(); | |
} | |
}); |
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
import UIKit | |
import Async | |
import RxSwift | |
class Store { | |
func get(river: River)(param: Double) -> Observable<Int64> { | |
let s1 = interval(param, MainScheduler.sharedInstance) | |
return merge(returnElements(s1, river.action)) >- debug("debug") | |
} | |
} |
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
copy( | |
Array.prototype.slice.call( | |
$('.repo-list-name') | |
.map(function (i, el) { | |
return '- [' +el.children[0].textContent.trim() + '](' + | |
el.children[0].href + ') - ' + | |
el.nextElementSibling.textContent.trim(); | |
}), | |
0) | |
.join('\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
func cachePrevious<E>(source: Observable<E>) -> Observable<(E?, E)> { | |
var previous: E? | |
return source >- map { | |
let pre = previous | |
previous = $0 | |
return (pre, $0) | |
} | |
} |