Skip to content

Instantly share code, notes, and snippets.

View Verkalets's full-sized avatar
🚀
Deliver amazing products with best engineering teams

Ivan Verkalets Verkalets

🚀
Deliver amazing products with best engineering teams
View GitHub Profile
class City
include Mongoid::Document
include Mongoid::Timestamps
include Geocoder::Model::Mongoid
field :name, type: String
field :hotel_id, type: String
field :description, type: String
field :user_email, type: String
field :min_price, type: String
require 'spec_helper'
describe User do
let(:user) { FactoryGirl.build(:user) }
let(:authentication) { FactoryGirl.build(:authentication) }
describe "#create" do
it "enqueues welcome email" do
Sidekiq::Extensions::DelayedMailer.jobs.should be_empty
user.save
class CitiesController < ApplicationController
before_action :set_city, only: [:show, :edit, :update, :destroy, :map_cities, :blog_cities]
load_and_authorize_resource param_method: :my_sanitizer
# GET /cities
# GET /cities.json
def index
@cities = City.all
@deals = Hotel.where(deals: true).where(published: true).limit(3)
@cities_by_rating = City.asc(:rating).limit(3)
class App.Views.Expences extends Backbone.View
template: HandlebarsTemplates['app/templates/expences']
events:
'click a#new_expence': 'newExpence'
initialize: ->
@listenTo @collection, 'reset', @render
@listenTo App.Vent, 'expence:create', @addToCollection
class ModelsPersistors::Crunchbase::Person
@@neo = Neography::Rest.new
def initialize(json_data)
data = json_data["data"]
@uuid = data["uuid"]
save(data)
end
@Verkalets
Verkalets / models_list
Last active August 29, 2015 14:14
Models List
Models
Fee Complete S
Distribution Complete S
BPCTeam Validation V
ArFile Complete V
<option value="Europe/Belgrade">Europe/Belgrade (Central European Time)</option>
<option value="Europe/Berlin">Europe/Berlin</option>
<option value="Europe/Bratislava">Europe/Bratislava (Central European Time)</option>
<option value="Europe/Brussels">Europe/Brussels (Central European Time)</option>
<option value="Europe/Budapest">Europe/Budapest (Central European Time)</option>
<option value="Europe/Copenhagen">Europe/Copenhagen (Central European Time)</option>
<option value="Europe/Gibraltar">(GMT+1:00) Europe/Gibraltar (Central European Time)</option>
<option value="Europe/Ljubljana">(GMT+1:00) Europe/Ljubljana (Central European Time)</option>
<option value="Europe/Luxembourg">(GMT+1:00) Europe/Luxembourg (Central European Time)</option>
<option value="Europe/Madrid">(GMT+1:00) Europe/Madrid
@Verkalets
Verkalets / Description.md
Created March 22, 2017 11:33 — forked from taras2358/Description.md
Rails e-commerce exercise

Given you have Rails e-commerce website. There are Product and Category models which have has_and_belongs_to_many relationship.

models/product.rb

class Product
  has_and_belongs_to_many :categories
end

models/category.rb

@Verkalets
Verkalets / users.json
Created March 31, 2020 17:37
users.json
[
{
"User": "Jeff",
"Email": "jeffsherwin@gmail.com",
"": "",
"__1": "",
"__2": ""
},
{
"User": "Carrie",
@Verkalets
Verkalets / shows.json
Created March 31, 2020 17:39
shows.json
[
{
"show_title": "Stranger Things",
"show_title_url": "https://reelgood.com/show/stranger-things-2016",
"show_maturity_rating": "Rated: 14+ (TV-14)",
"show_genre": "Drama, Fantasy, Horror, Mystery, Science Fiction, Thriller, Action & Adventure",
"show_length": "30m",
"show_year": 2016,
"show_imdb": "8,8",
"show_description": "When a young boy vanishes, a small town uncovers a mystery involving secret experiments, terrifying supernatural forces, and one strange little girl.",