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 SubscriptionDecorator < Draper::Base | |
include SubscriptionHelper | |
include ActionView::Helpers::TagHelper | |
decorates :subscription | |
attr_accessor :current_timeline, :today, :current_period, :term_factor, | |
:last_timeline_in_period, :updated_date, :current_event_type | |
def initialize(subscription, options = {}) |
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 SubscriptionDecorator < Draper::Base | |
include SubscriptionHelper | |
include ActionView::Helpers::TagHelper | |
decorates :subscription | |
attr_accessor :current_timeline, :today, :current_period, :term_factor, | |
:updated_date, :current_event_type | |
def initialize(subscription, options = {}) |
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 MailDownloader | |
class << self | |
def download | |
match = [] | |
links = [] | |
gmail = Gmail.connect(Settings.gmail.username, Settings.gmail.password) | |
gmail.inbox.find(:unread).each do |email| | |
if email.subject.slice(/new links/i) | |
match << email.message.to_s.scan(/(http:\/\/|www.)([\w-]+\.)+([\w-]+\s)/) |
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 SudokuBoard | |
def initialize(filename) | |
init_defaults() | |
@boards = parse_file(filename) | |
@solved = [] | |
@boards.each do |board| | |
solved_board = solve(parse_board(board)) | |
@solved.push solved_board | |
display(solved_board) | |
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 palindrom?(str) | |
str == str.reverse() | |
end | |
puts (ARGV[0].to_i...ARGV[1].to_i).select { |n| palindrom?(n.to_s) && palindrom?(n.to_s(2)) }.reduce(:+) |
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).ready -> | |
$('#flip').click -> | |
$('.flip-container').toggleClass('front back') |
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
ripple = (el, color) -> | |
$div = $('<div/>') | |
elOffset = el.offset() | |
xPos = elOffset.left | |
yPos = elOffset.top | |
$div.addClass 'ripple-effect' | |
$ripple = $('.ripple-effect') | |
$ripple.css 'height', el.height() | |
$ripple.css 'width', el.height() | |
$div.css( |
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
decribe 'Task creation' do | |
scenario 'Create task' do | |
let(:name) { 'New name' } | |
before do | |
visit tasks_path | |
click_link 'New Task' | |
within '.modal-content' do | |
fill_in 'Name', with: 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
find(:css, '#new-task').trigger(:click) |
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
page.execute_script("document.querySelector('#new-task').click()") |
OlderNewer