import until from 'path/to/until'
import { shallow } from 'enzyme'
const EnhancedFoo = compose(
connect(...),
withHandlers(...),
withContext(...)
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
Verifying my Blockstack ID is secured with the address 1JqirHH1XZHgu6BXnVmYu1jC9Bn5nq3UPz https://explorer.blockstack.org/address/1JqirHH1XZHgu6BXnVmYu1jC9Bn5nq3UPz |
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 {action1, action2} from "myActions"; | |
import {bindActionCreators} from "redux"; | |
const mapDispatchToProps(dispatch) => { | |
return { | |
manuallyBoundAction : (...args) => dispatch(action1(...args)), | |
autoBoundAction : bindActionCreators(action2, dispatch), | |
multipleActionsTogether : bindActionCreators({action1, action2}, dispatch) | |
} | |
}; |
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
jest.mock( 'TextInput', () => { | |
const RealComponent = require.requireActual( 'TextInput' ) | |
const React = require( 'React' ) | |
class TextInput extends React.Component { | |
render() { | |
delete this.props.autoFocus | |
return React.createElement( 'TextInput', this.props, this.props.children ) | |
} | |
} | |
TextInput.propTypes = RealComponent.propTypes |
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 el = document.createElement('script'); | |
// el.src = "https://raw.githubusercontent.com/lodash/lodash/3.10.1/lodash.min.js"; | |
// el.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js"; | |
el.src = "//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js"; | |
el.type = "text/javascript"; | |
document.head.appendChild(el) |
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 React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { TabNavigator } from 'react-navigation' | |
import TheListView from './TheListView' | |
import TheFormView from './TheFormView' | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<AppNavigator /> |
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
capabilities_config = { | |
:version => "43", | |
:browserName => "firefox", | |
:platform => "OS X 10.9", | |
:name => "Whatever name I want" | |
} | |
sauce_username = ENV['SAUCE_LABS_USERNAME'] | |
sauce_api_key = ENV['SAUCE_LABS_API_KEY'] | |
sauce_url = "http://#{sauce_username}:#{sauce_api_key}@ondemand.saucelabs.com:80/wd/hub".strip |
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
# Original source - https://coderwall.com/p/bkrg8a/ruby-wait_while | |
# Public: Wait while block returns false by repeatedly | |
# calling the block until it returns true. | |
# | |
# Useful to wait for external systems to do something. | |
# Like launching daemons in integration tests. Which | |
# you're not actually doing right? >_< | |
# | |
# timeout - Integer specifying how many seconds | |
# to wait for. |
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
# This file would go in config/initializers/pry.rb in a Rails project | |
old_prompt = Pry.config.prompt | |
env_str = "#{Rails.application.class.parent}-#{Rails.env}".upcase | |
if Rails.env.production? | |
# Can't do this because it messes with bash history for some reason | |
# env = Pry::Helpers::Text.red(env_str) | |
env = "\001\e[0;31m\002#{env_str}\001\e[0m\002" | |
else | |
# Can't do this because it messes with bash history for some reason | |
# env = Pry::Helpers::Text.green(env_str) |
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
(function() { | |
window.JDI = window.JDI || {}; | |
/* | |
JDI.register - register a module on the "JDI" global | |
Usage: | |
with a namespace: JDI.register("foo", {bar: myFunc}) => JDI.foo.bar = myFunc | |
without a namespace: JDI.register({bar: myFunc}) => JDI.bar = myFunc | |
*/ | |
JDI.register = function(){ |
NewerOlder