Skip to content

Instantly share code, notes, and snippets.

const { Component } = React
const { Provider, connect } = ReactRedux
const { combineReducers } = Redux
const serverResponse = (size = 10) =>
Array.from({length: size}, () => Math.floor(Math.random() * size));
let mapStateToProps
//============================================================
const { Provider, connect } = ReactRedux
const appendItem = () => ({
type: 'APPEND_ITEM'
})
const initialState = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const reducer = (state = initialState, action) => {
switch(action.type) {
# Active Job
# Changed enqueueing method from +enqueue+ to +perform_later+
# beta1
MyJob.enqueue(*args)
# beta2
MyJob.perform_later(*args)
# Changed the way we schedule jobs
# beta1

Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.

So instead of this:

require 'carrierwave/processing/mini_magick'

require "fog"
connection = Fog::Storage.new(
provider: "AWS",
aws_access_key_id: YOUR_AWS_ACCESS_KEY_ID,
aws_secret_access_key: YOUR_AWS_SECRET_ACCESS_KEY,
host: "s3.amazonaws.com",
scheme: "http",
connection_options: {
proxy: "http://127.0.0.1:8080",

Capybara

save_and_open_page

Matchers

have_button(locator)