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
require 'rspec/expectations' | |
require 'capybara/cucumber' | |
require 'capybara/poltergeist' | |
require 'spreewald/web_steps' | |
Capybara.run_server = false #Disable internal forking | |
if ENV['IN_BROWSER'] | |
# On demand: non-headless tests via Selenium/WebDriver | |
# To run the scenarios in browser (default: Firefox), use the following command line: |
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
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-checkbox/paper-checkbox.html"> | |
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<link rel="import" href="../paper-slider/paper-slider.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
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
require 'json' | |
require 'typhoeus' | |
require 'logger' | |
module Yoox | |
class Config | |
class << self | |
attr_accessor :host, :logger, :api_key |
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
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
# The following lines should come as no surprise. Except by |
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
require 'net/http' | |
require 'uri' | |
require 'nokogiri' | |
require 'json' | |
url = URI.parse('http://www.bikemi.com/localizaciones/localizaciones.php') | |
res = Net::HTTP.start(url.host, url.port) {|http| | |
http.get('/localizaciones/localizaciones.php') | |
} |
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
GeoLocator = (function() { | |
function GeoLocator() { | |
this.watch = __bind(this.watch, this); this.watcher = navigator.geolocation.watchPosition(this.watch, this.geo_error, { | |
enableHighAccuracy: true, | |
frequency: 3000, | |
maximumAge: 2000, | |
timeout: 27000 | |
}); | |
this.map = new Map(document.getElementById("map")); |
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
Array::randomize = -> @sort -> 0.5 - Math.random() | |
class Boggle | |
constructor: -> | |
@dices = [ | |
['A', 'Z', 'F', 'S', 'Qu', 'B'], | |
['G', 'C', 'S', 'V', 'P', 'A'], | |
['H', 'I', 'S', 'E', 'R', 'N'], | |
['A', 'I', 'O', 'B', 'M', 'C'], | |
['T', 'I', 'V', 'E', 'N', 'G'], |
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
require 'csv' | |
namespace :locale do | |
namespace :translations do | |
desc 'export translations' | |
task :export => :environment do | |
params_check | |
locale = ENV['locale'].to_sym | |
model = translate_model |
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 Admin::BaseController < InheritedResources::Base | |
before_filter :persist_params, :only => :index | |
def persisted_params | |
(self.class.to_s + "_persisted").to_sym | |
end | |
def persist_params | |
session[persisted_params] ||= {} | |
[:page, :search].each do |k| |
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 Node < ActiveRecord::Base | |
attr_accessor :related_nodes_ids | |
after_save :save_related_nodes | |
before_destroy :clear_related_nodes | |
def related_nodes=(nodes_ids) | |
@related_nodes_ids = nodes_ids.compact.reject { |s| s.blank? } | |
end |