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
$('body').on('click', '.ember-view.availability', function(){ | |
setTimeout(function() { | |
if($('#voice-control').hasClass('off')) { | |
$('#branding_header').css('background-color', ''); | |
} else { | |
$('#branding_header').css('background-color', 'green'); | |
} | |
}, 1000); | |
}); |
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
/opt/boxen/homebrew/bin/postgres -p 15432 -D /opt/boxen/data/postgresql -r /opt/boxen/log/postgresql/server.log |
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
# Description: | |
# Ask Hubot to perform actions on Heroku | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
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 send_cool_event | |
Pusher["fancy-pants-channel"].trigger('cool-event', pants_json) | |
end | |
handle_asynchronously :send_cool_event |
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 send_cool_event | |
Pusher["fancy-pants-channel"].trigger_async('cool-event', pants_json) | |
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
def my_method | |
something = "fdsfs ".strip! | |
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
def plan_change_preview(new_plan_id) | |
api_url = "https://#{Chargify.subdomain}.chargify.com/subscriptions/#{subscription_id}/migrations/preview.json" | |
data = {:migration => {:product_handle => p_handle} } | |
response = HTTParty.post(api_url, :body => data.as_json, :basic_auth => {:username => Chargify.api_key, :password => 'X'}) | |
response.parsed_response.first[1] | |
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
def contrasting_text_color(hex_color) | |
color = hex_color.gsub('#','') | |
convert_to_brightness_value(color) > 382.5 ? darken_color(color) : lighten_color(color) | |
end | |
def convert_to_brightness_value(hex_color) | |
(hex_color.scan(/../).map {|color| color.hex}).sum | |
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
# Amount should be a decimal between 0 and 1. Lower means darker | |
def darken_color(hex_color, amount=0.4) | |
hex_color = hex_color.gsub('#','') | |
rgb = hex_color.scan(/../).map {|color| color.hex} | |
rgb[0] = (rgb[0].to_i * amount).round | |
rgb[1] = (rgb[1].to_i * amount).round | |
rgb[2] = (rgb[2].to_i * amount).round | |
"#%02x%02x%02x" % rgb | |
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
def subscription_state_change | |
begin | |
account = Account.find(@subscription.customer.reference) | |
account.subscription_state = @subscription.state | |
account.subscription_billing_date = @subscription.current_period_ends_at | |
account.save(:validate => false) | |
render :nothing => true, :status => 200 | |
rescue Exception => e | |
notify_hoptoad(e) #If you use hoptoad... | |
render :nothing => true, :status => 422 and return |
NewerOlder