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
admin.directive 'gpnRequired', ['$compile', ($compile) -> | |
isEmpty = (value) -> | |
angular.isUndefined(value) || value is '' || value is null || (angular.isArray(value) && value.length is 0) | |
link = ($scope, $element, $attributes, $control) -> | |
title = I18n.t('js.required') | |
name = $scope.$eval($attributes.gpnRequried) || $attributes.gpnRequired | |
template = "<span class = 'error' ng-show = \"form['#{name}'].$error.gpnRequired\">#{title}</span>" | |
angular.element($compile(template)($scope)).insertAfter($element) |
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
... | |
grunt.registerTask('heroku:production' , 'build'); | |
}; |
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
it 'should work faster using ranges in threads on aggregate' do | |
Report1 = Class.new do | |
include Mongoid::Report | |
report 'example' do | |
attach_to Model do | |
group_by :day | |
column :field1 | |
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
{ '$match' => { :campaign_id => { '$exists' => true, '$ne' => nil } } }, |
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 V2 | |
class ReportByCampaign < BaseReport | |
report 'campaign' do | |
attach_to DailyEventAd, as: 'ads' do | |
# We are using columns for resolving dynamic columns on rows | |
columns COLUMNS | |
# Fields Mapping is linking columns fields and row fields | |
mapping AD_FIELDS |
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
app_name: ->(context, row, options) do | |
return if options.fetch(:summary) | |
app_id = row[options[:mapping]['app_id']] | |
return unless context.apps[app_id] | |
context.apps[app_id].name | |
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
report_klass = Class.new do | |
include Mongoid::Report | |
report 'example' do | |
columns :field4 => ->(context, row, options) { row['field3'] } | |
column :field3, :field4 | |
attach_to 'pregenerated' do | |
group_by :field1 |
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 Api::Client::V1::Users < Grape::API | |
resources :users do | |
RegistrationSteps = [ | |
->(user) { FollowersPopulationService.new(user).create }, | |
->(user) { TimelinesRegistrationService.new(user).create }, | |
] | |
params do | |
requires :auth_token, type: String, desc: "Auth token picked up on the user activity on the device" |
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
RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.1.2 |
OlderNewer