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
unless $RAKE_TASK # don't register participants in rake tasks | |
RuoteKit.engine.register do | |
# register your own participants using the participant method | |
# | |
# Example: participant 'alice', Ruote::StorageParticipant see | |
# http://ruote.rubyforge.org/participants.html for more info | |
# register the catchall storage participant named '.+' | |
bob Ruote::StorageParticipant | |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.6' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'pg' | |
gem 'therubyracer', :platforms => :ruby | |
# Gems used only for assets and not required |
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
bundle install | |
Fetching gem metadata from https://rubygems.org/.......... | |
Fetching gem metadata from https://rubygems.org/.. | |
Resolving dependencies... | |
Bundler could not find compatible versions for gem "railties": | |
In Gemfile: | |
rails (= 4.0.0) ruby depends on | |
railties (= 4.0.0) ruby | |
coffee-rails (= 4.0.0) ruby depends on |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0' | |
# Use sqlite3 as the database for Active Record | |
gem 'sqlite3' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
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
xml = params[:upload] | |
xml = Nokogiri::XML(xml) | |
xml.xpath('//movie').each do | movie | | |
#wanna create a Movie instance here | |
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
class Movie < ActiveRecord::Base | |
belongs_to :channel | |
validate :does_not_overlap, :valid_times | |
def self.from_xml(xml) | |
id = xml.attr('id') #parse movie id | |
channel = Channel.find_by_codename(xml.child.name) #get the channel from db | |
name = xml.child.xpath('name').text #get name | |
start_time = parse_time(xml.child.xpath('start_time').text) | |
end_time = parse_time(xml.child.xpath('end_time').text) |
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
num=0 | |
print("ABCDEFGH") | |
for fila in range (1,9): | |
print(num+1,end="") | |
for columna in range (1,9): | |
if columna%2 == fila%2: | |
print("\u25a1",end="") | |
else: | |
print("\u25a0",end="") | |
print(num+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
num=0 | |
print("ABCDEFGH") | |
for fila in range (0,8): | |
print(num,end="") | |
for columna in range (0,8): | |
if columna%2 == fila%2: | |
print("\u25a1",end="") | |
else: | |
print("\u25a0",end="") | |
print(num,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
print(" A B C D E F G H") | |
for fila in range(8): | |
print(8-fila,end=" ") | |
for columna in range(8): | |
if columna%2 == fila%2: | |
print("\u25a1",end=" ") | |
else: | |
print("\u25a0",end=" ") | |
print(8-fila) | |
print(" A B C D E F G H") |
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
am.directive("showXeditable", function() { | |
return { | |
link: function(scope, element, attrs) { | |
if(attrs.isnew){ | |
scope.$editable.show(); | |
} | |
}, | |
require: 'editableText', | |
restrict: 'A', | |
priority: 1000 //ensure it runs AFTER editableText directive |
OlderNewer