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
| var jade = require('jade') | |
| , srcDir = __dirname + '/public/templates' | |
| , dstPath = __dirname + '/public/js/templates.js' | |
| , util = require('util') | |
| , fs = require('fs'); | |
| function writeTemplates (templates) { | |
| var out = '(function () {\n' | |
| out += 'this.JST = this.JST || {};\n'; | |
| out += '' + templates; |
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
| if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
| var Storage = function (type) { | |
| function createCookie(name, value, days) { | |
| var date, expires; | |
| if (days) { | |
| date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); | |
| expires = "; expires="+date.toGMTString(); |
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
| Role::LIST.each do |role| | |
| Given "I am a logged admin with the role #{role}" do | |
| @current_admin_user = Factory(:admin_user, :email => "#{role}@season.es", :password => 'contrasenya', :password_confirmation => 'contrasenya', :role => Role.find_or_create_by(kind: role)) | |
| login_as_admin(@current_admin_user) | |
| 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
| //This needs to be run when you're on the amiando euruko page, because of the same origin policy on iframes | |
| setTimeout(function rl(){ | |
| function aux() { | |
| document.body.innerHTML= ''; | |
| document.write("<iframe id='i' src='http://www.amiando.com/euruko2012.html' style='width: 100%;height: 100%'></iframe>"); | |
| setTimeout(rl, 1000); | |
| } | |
| console.log('reloading'); | |
| var iframe = document.getElementById("i"); | |
| if (!iframe) { |
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 Product extends Backbone.Model | |
| initialize: -> | |
| @components = new App.Collections.Components(@components || []) | |
| @components.url = "#{@url()}/components" | |
| url: -> | |
| '/products/' + @id | |
| #exporting | |
| App.Models.Product = Product |
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
| Rails.configuration.cache_classes = true | |
| Rails.configuration.threadsafe! | |
| Rails.configuration.allow_concurrency = true | |
| require "#{Rails.root}/test/factories" | |
| Dir.glob(File.join(Rails.root, 'app', '{lib,app}', '*.rb')).each{|f| require f} | |
| Rails.application.eager_load! | |
| puts "Creating users..." | |
| users = [] |
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/env ruby | |
| require 'eventmachine' | |
| require 'pty' | |
| class ShellServer | |
| class HandlerWriter | |
| def add_source(source) | |
| @sources ||= [] | |
| @sources << source | |
| 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
| #encoding: UTF-8 | |
| require 'resque_mail' | |
| class PostOffice < ActionMailer::Base | |
| extend ResqueMail | |
| @queue = :mail | |
| 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
| total_points is a not unique field of player. Here its value is 0 for every player |
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 Accommodation < ActiveRecord::Base | |
| has_many :pictures | |
| end |