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
<?php | |
/** | |
* @file | |
* leaflet powered custom maps for townelake homes. | |
* by Jake Craige @ Poetic Systems | |
*/ | |
/** | |
* How To Import Lots | |
* TL:DR Delete all current lots(feed/json), import feed lots, import json lots |
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 Product < ActiveRecord::Base | |
belongs_to :category | |
has_many :trackings | |
has_many :site_product_prices, -> { order(:id => :asc) } | |
has_many :user_price_alerts | |
after_create :extract_color_from_name, :update_brand_and_model_number_if_blank, :remove_false_values, :run_delayed_jobs | |
validates_presence_of :name |
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
# Credits to @danyhunter for initial idea and implementation | |
# https://github.com/danyhunter | |
( () -> | |
if typeof angular is 'undefined' | |
return | |
module = angular.module 'SteroidsKeyboardFix', [] | |
module.directive 'input', () -> |
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
document.addEventListener('resume', function() { | |
if(window.ea_timeoutId) { | |
clearTimeout(window.ea_timeoutId); | |
} | |
window.ea_timeoutId = setTimeout(function() { | |
launchURL = steroids.app.getLaunchURL(); | |
matches = launchURL.toString().match(/\/\/(\w+)\?\w+=(\w+)/); | |
action = matches[1]; | |
id = matches[2]; |
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.directive 'selectallgroup', -> | |
restrict: 'A' | |
link: (scope, ele, attrs)-> | |
$(ele).on 'change', -> | |
$(@).parents('h3').next('ul').find('input[type=checkbox]').each ()-> | |
unless $(@).is(':disabled') | |
selectAllChecked = $(ele).prop('checked') | |
if selectAllChecked | |
$(@).prop('checked', 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
$scope.$watch 'invites', ()-> | |
selected = _.map $scope.invites, (ele, index)-> | |
parseInt(index) if ele is true | |
$scope.invitesPrepared = _.compact selected # remove undefined's | |
$scope.inviteLength = $scope.invitesPrepared.length | |
, 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
<div ng-show="!_.isEmpty(notInvitedGuests)" ng-repeat="(groupName, guests) in notInvitedGuests"> | |
<h3 class="topcoat-list__header caps"> | |
<label class="topcoat-checkbox"> | |
<input type="checkbox" selectallgroup> | |
<div class="topcoat-checkbox__checkmark"></div> | |
</label> | |
{{ groupName }} - Not Yet Invited | |
</h3> | |
<ul class="topcoat-list__container"> | |
<li class="topcoat-list__item small disclosure" ng-show="guests" ng-repeat="guest in guests"> |
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 ChangeAdditionalInformationColumnsToPromos < ActiveRecord::Migration | |
class RealPromo < ActiveRecord::Base; self.table_name = 'promos'; end | |
def up | |
rename_column :additional_informations, :body, :description | |
add_column :additional_informations, :title, :string | |
add_column :additional_informations, :url, :string | |
add_column :additional_informations, :phone, :string | |
add_column :additional_informations, :type, :string, default: 'Other' |
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
resources :others, controller: :additional_informations, type: "Other" | |
resources :promos, controller: :additional_informations, type: "Promo" | |
resources :gifts, controller: :additional_informations, type: "Gift" | |
resources :travels, controller: :additional_informations, type: "Travel" | |
resources :lodgings, controller: :additional_informations, type: "Lodging" |
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 information_type | |
params[:type].constantize | |
end |