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
//rootReducer.js | |
import { combineReducers} from 'redux'; | |
//modules import | |
import app from './app'; | |
import topics from './topics'; | |
const combinedReducers = combineReducers({ | |
[topics.constants.NAME] : topics.reducer, |
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
//index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import {Provider} from 'react-redux'; | |
import { createStore } from 'redux'; | |
import AppContainer from './app/containers/AppContainer'; | |
import todoApp from './rootReducer'; | |
import injectTapEventPlugin from 'react-tap-event-plugin'; |
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
{ | |
visibilityFilter: 'SHOW_ALL', | |
todos: [ | |
{ | |
text: 'Consider using Redux', | |
completed: true, | |
}, | |
{ | |
text: 'Keep all state in a single tree', | |
completed: false |
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
module Exceptions | |
extend ActiveSupport::Concern | |
included do | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from Exception, with: :render_error | |
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found | |
rescue_from ActionController::RoutingError, with: :render_not_found | |
rescue_from ActionController::UnknownController, with: :render_not_found | |
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized |
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 Chart | |
def time_data_with_irregular_intervals(series, *args) | |
options = args.extract_options! | |
LazyHighCharts::HighChart.new('basic_line') do |f| | |
f.chart({ type: 'spline', | |
marginRight: 130, | |
marginBottom: 60 }) | |
f.title({ | |
text: options[:title], |
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
def set_project_and_token_from_request request | |
@project_number = request.project_number | |
@token = request.token | |
@ga_data.merge_dimensions userID: @project_number | |
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
AEGON.Errors = { | |
call_center: function(path) { | |
call_center = $.get(path); | |
call_center.done(function(data, response) { | |
$.fancybox({ | |
ajax: true, | |
content: data, | |
afterShow: function() { | |
AEGON.Errors.active_form(); |
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 MainGraph | |
include ActiveModel::Validations | |
attr_reader :company, :starts_at, :ends_at | |
#attr_reader :graph_window_at, :period_search, :project_periods, :onthebench, :billable_by_period, :unbillable_by_period, | |
# :free_by_period, :billable, :unbillable, :free, :graph_form | |
validate :validate_graph | |
#def initialize(weeks_number, graph_form, company) |
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
100.times{|i| puts i} | |
'this is a string'.reverse | |
[1,2,3,4,5].select{|x| x % 2 == 0} | |
user = User.new(name: 'Bruce', last_name: 'Dickinson') |
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
# POST /clients | |
def create | |
@client = @company.clients.new(client_params) | |
if @client.save | |
redirect_to company_clients_url(@company) | |
else | |
render action: 'new' | |
end | |
end |