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
<TextInput | |
type="text" | |
id="First name" | |
placeholder="Enter first name" | |
{...register('firstName')} | |
/> |
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
service: social-feeds | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: dev | |
region: eu-west-1 | |
environment: | |
SOCIAL_FEED_TWITTER_TABLE: "twitter-feed-${self:service}-${opt:stage, self:provider.stage}" | |
iamRoleStatements: | |
- Effect: Allow |
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, { Component } from 'react'; | |
import { createStore, applyMiddleware, combineReducers, compose } from 'redux'; | |
import Provider from 'react-redux'; | |
import thunk from 'redux-thunk'; | |
import TodoList from '../containers/TodoList'; | |
import reducers from '../reducers'; | |
import init from '../actions/ListActions'; | |
class TodoAppClinet extends Component { |
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
sphinx_scope(:ny_ca_and_ma_only) do | |
{:conditions => {:state => ['MA', 'CA', 'NY']}} | |
end |
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
define_index do | |
indexes name, :sortable => true, :infixes => true | |
indexes nickname, :sortable => true, :infixes => true | |
indexes city_code | |
indexes address | |
indexes state | |
indexes city, :sortable => true, :infixes => true | |
set_property :enable_star => 1 # Both are needed to allow stars in search | |
set_property :min_prefix_len => 1 # Both are needed to allow stars in search | |
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
<!-- begin olark code --> | |
<script data-cfasync="false" type='text/javascript'> | |
<% unless I18n.locale == :sv -%> | |
olark.configure('locale.feedback_survey_question_chat_text', 'How satisfied were you with this chat?'); | |
olark.configure('locale.feedback_survey_question_operator_intelligence_text', 'How knowledgeable was the chat agent?'); | |
olark.configure('locale.feedback_survey_question_operator_speed_text', 'How responsive was the chat agent?'); | |
olark.configure('locale.feedback_survey_question_operator_attitude_text', 'How friendly was the chat agent?'); | |
olark.configure('locale.feedback_survey_question_1_text', 'Question 1 of 5'); |
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
params[:user] = {:name => 'Foo',:email => 'foo@example.com'} | |
@user = User.new(params[:user]) |
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
config.active_record.whitelist_attributes = true |
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 BooksController < ApplicationController | |
def create | |
@book = Book.new(params[:book], as : current_user.try(:admin) ? :admin : :user) | |
respond_to do |format| | |
if @book.save | |
format.html { redirect_to @book notice 'Book was successfully created.' } | |
else | |
format.html { render action : "new" } | |
end | |
end |
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 Book < ActiveRecord::Base | |
attr_accessible :name, :public, :author | |
end |
NewerOlder