Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/ruby | |
BASEDIR = "#{ENV['HOME']}/html/ftp" | |
FOLDERS = { | |
'push' => 'public', | |
'upload' => 'pull', | |
} | |
FOLDERS.each do |src, dst| | |
src_dir = "#{BASEDIR}/#{src}" | |
dst_dir = "#{BASEDIR}/#{dst}" | |
files_from_both_folders = (Dir.entries(src_dir) + Dir.entries(dst_dir)).uniq |
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
fibonacci = Enumerator.new do |yielder| | |
n1, n2 = 1, 1 | |
loop do | |
yielder.yield n1 | |
n1, n2 = n2, n1 + n2 | |
end | |
end | |
p fibonacci.first(20) |
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
Hi Alexey, | |
Thank you for creating your Campus MovieFest team, test. Nice team name, btw. | |
Check out some key details for your upcoming CMF Event: | |
CMF México - Rosarito | |
Find out all the details online, too |
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
include FactChecker | |
define_fact :festivals, :if => lambda{|o| o.festivals > 0} | |
define_fact :scenario, :if => :scenario? | |
define_fact :requiest => [:festivals, :scenario], :if => :equipment? | |
define_fact :members => :request, :if => lambda{|o| o.members > 0} | |
define_fact :basic_info => :request, :if => lambda{|o| o.name.present? && o.description.present?} | |
define_fact :submit => [:members, :basic_info], :if => :submitted? |
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 festivals_possible? | |
true | |
end | |
def festivals_completed? | |
festivals.size > 0 && | |
festivals_possible? | |
end | |
def scenario_possible? | |
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
def festivals_completed? | |
festivals.size > 0 | |
end | |
def scenario_completed? | |
scenario.present?? | |
end | |
def request_completed? | |
equipment.present? && |
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 festivals_completed? | |
festivals.size > 0 | |
end | |
def scenario_completed? | |
scenario.present?? | |
end | |
def request_completed? | |
equipment.present? |