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
| def top_retailers | |
| retailers = self.site_product_prices.last_24_hours.trusted.by_price | |
| retailers = retailers.group_by { |retailer| retailer.site } | |
| .map(&:last) | |
| .each{ |sites_array| sites_array.sort_by! { |site| site.weight }.reverse! } | |
| .map(&:first).reverse | |
| .sort_by { |x| x.price } | |
| if retailers.count > 1 |
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
| "Jake Craige & Matthew Hager | |
| " Setup {{{ | |
| set rtp+=~/.poetic_dotfiles/powerline/powerline/bindings/vim/ | |
| if filereadable(expand("~/.vimrc.bundles")) | |
| source ~/.vimrc.bundles | |
| endif | |
| filetype plugin indent on | |
| " }}} |
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
| saveNewPhoto: -> | |
| newImage = @store.createRecord 'event_image', { | |
| image: @get 'newPhotoImage' | |
| caption: @get 'newPhotoCaption' | |
| event: @get 'model' | |
| } | |
| newImage.save().then ((img)=> | |
| @get('event_images').pushObject img | |
| Ea.get('flash').success 'Image added' | |
| ), (=> |
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
| class Travel < AdditionalInformation; end | |
| [:test, :bob].each_with_object({}) do |key, res| | |
| res[key] = params[key] if params[key] | |
| end |
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
| EventAssist.EventsController = Em.ArrayController.extend Ea.ErrorFormatter, | |
| actions: | |
| createEvent: -> | |
| event = @get('newEvent') | |
| success = (savedEvent)=> | |
| @transitionToRoute('event.overview', savedEvent) | |
| Ea.get('flash').randAuccess 'success.created.event' | |
| event.save().then success, (response)=> | |
| @setErrors(response) |
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
| Ea.EventController = Em.ObjectController.extend | |
| actions: | |
| destroyEvent: -> | |
| success = (resModel)=> | |
| Ea.get('flash').randSuccess 'success.deleted' | |
| error = -> | |
| Ea.get('flash').randAlert 'error.general' |
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
| Em.ArrayProxy.createWithMixins Ember.SortableMixin, { | |
| content: @get('contacts') | |
| sortProperties: ['sort_key'] | |
| sortAscending: 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
| function getAll(collection, res){ | |
| collection.list(function(err, resModels, options){ | |
| var results = [], pages; | |
| if(err) { | |
| console.log(err); | |
| res.send(500); | |
| } | |
| console.log('page 1'); | |
| results.push(resModels); |
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
| Ea.GplacesAutocompleteComponent = Em.Component.extend | |
| tagName: 'input' | |
| classNames: ['google_places_ac'] | |
| attributeBindings: ['placeholder', 'type', 'value'] | |
| type: 'text' | |
| didInsertElement: -> | |
| autocomplete = new google.maps.places.Autocomplete($('.google_places_ac')[0], {}) | |
| #Fast click fix for gmaps | |
| g_autocomplete = $('body > .pac-container').filter(":visible") |
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
| <?php | |
| /** | |
| * @file | |
| * leaflet powered custom maps for newmark homes. | |
| */ | |
| $home_style = array( | |
| 'weight' => 1, | |
| 'color' => '#008000' | |
| ); |