Skip to content

Instantly share code, notes, and snippets.

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
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
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
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'
xml = params[:upload]
xml = Nokogiri::XML(xml)
xml.xpath('//movie').each do | movie |
#wanna create a Movie instance here
end
@bluehallu
bluehallu / Movi.rb
Last active December 26, 2015 05:19
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)
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="")
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="")
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")
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