This file contains hidden or 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
| if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| rvm use `cat .ruby-version`@`cat .ruby-gemset` | |
| fi |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Got this file from: https://gist.github.com/andreptb/57e388df5e881937e62a | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "win7-ie9" | |
| config.vm.box_url = "http://aka.ms/vagrant-win7-ie9" | |
| config.vm.boot_timeout = 500 | |
| config.vm.network "forwarded_port", guest: 3389, host: 3389, id: "rdp", auto_correct: true |
This file contains hidden or 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
| select * | |
| from records | |
| where PERIOD_ADD(DATE_FORMAT(NOW(),'%Y%m'), -1) = DATE_FORMAT(created_at,'%Y%m') |
This file contains hidden or 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(){ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |