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
require 'httparty' | |
require 'json' | |
require 'dotenv/load' | |
url = 'https://websiteURLgoesHere' | |
if ENV['RaspberryPi'] == true | |
require 'rpi_gpio' | |
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
require 'selenium-webdriver' | |
require 'dotenv/load' | |
require 'mailgun-ruby' | |
require 'open-uri' | |
require 'date' | |
require 'time' | |
require 'nokogiri' | |
require 'json' | |
require 'csv' |
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
require 'selenium-webdriver' | |
require 'dotenv/load' | |
require 'csv' | |
@headless = Selenium::WebDriver.for :firefox | |
def powershopLogin | |
@headless.navigate.to 'https://secure.powershop.com.au/' | |
username = @headless.find_element(:id, "email") |
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
irb(main):129:0> value_to_evaluate | |
=> "\u00001\u00004\u00009\u00003\u0000" | |
irb(main):130:0> puts value_to_evaluate | |
1493 | |
=> nil | |
irb(main):131:0> value_to_evaluate == 1493 | |
=> false | |
irb(main):132:0> |
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
Link.all.each do |ym| | |
begin | |
ym.image.cache_stored_file! | |
ym.image.retrieve_from_cache!(ym.image.cache_name) | |
ym.image.recreate_versions! | |
ym.save! | |
end | |
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
<% @goals.each do |goal| %> | |
<% if goal.committments.count == 1 && goal.committments.first.private_goal == true %> | |
<% else %> | |
<li> | |
<% if goal.committments.count > 1 %> | |
<p><small><%= goal.committments.count %> people want to</small></p> | |
<% else %> | |
<p><small><%= goal.committments.count %> person wants to</small></p> | |
<% 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
def update | |
# @baby = Baby.find(params[:id]) | |
if @baby.update_attributes(params[:baby]) | |
if @baby.previous_changes[:notify] | |
redirect_to root_url, notice: "Done" | |
else | |
redirect_to(root_url(:host => with_subdomain(@baby.subdomain)), :notice => 'Your baby was successfully updated and everyone has been told the good news.') | |
end | |
else |
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 update | |
if @baby.update_attributes(params[:baby]) | |
if baby.notify.changed? | |
flash[:notice] = "Done" | |
else | |
redirect_to(root_url(:host => with_subdomain(@baby.subdomain)), :notice => 'Your baby was successfully updated and everyone has been told the good news.') | |
end | |
else | |
render :action => "edit" | |
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
def update | |
if @baby.update_attributes(params[:baby]) | |
if params[:notify] == true | |
flash[:notice] = "Done" | |
else | |
redirect_to(root_url(:host => with_subdomain(@baby.subdomain)), :notice => 'Your baby was successfully updated and everyone has been told the good news.') | |
end | |
else | |
render :action => "edit" | |
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
class PagesController < ActionController::Base | |
def home | |
end | |
def sign_up_redirect | |
redirect_to new_registration_path(Parents) | |
end | |
end |
NewerOlder