I hereby claim:
- I am markevich on github.
- I am markevich (https://keybase.io/markevich) on keybase.
- I have a public key ASASoVOdpZwWiojXuSpm7fV94WxFcgQ67v_w2q9GMhybHQo
To claim this, I am signing this object:
| #!/bin/bash | |
| # This script is enabling (uncommenting) the Russian locale and regenerates them | |
| sudo steamos-readonly disable | |
| sudo pacman-key --init | |
| sudo pacman-key --populate archlinux | |
| sudo pacman -S glibc | |
| sudo sed -i "s%#ru_RU.UTF-8 UTF-8%ru_RU.UTF-8 UTF-8%" /etc/locale.gen | |
| sudo locale-gen |
I hereby claim:
To claim this, I am signing this object:
| {"info":{"title":"API title","version":"0.0.1"},"swagger":"2.0","produces":["application/xml","application/json"],"securityDefinitions":{"api_key":{"type":"apiKey","name":"api_key","in":"query"}},"security":[{"api_key":[]}],"host":"localhost:3000","tags":[{"name":"api","description":"Operations about apis"}],"paths":{"/api/client/v1/users/{id}":{"get":{"summary":"Get user info by ID","description":"Get user info by ID","produces":["application/json"],"parameters":[{"in":"path","name":"id","description":"User ID","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"Get user info by ID","schema":{"$ref":"#/definitions/User"}}},"tags":["api"],"operationId":"getApiClientV1UsersId"}},"/api/vendor/v1/users/{id}":{"get":{"summary":"Get user info by ID","description":"Get user info by ID","produces":["application/json"],"parameters":[{"in":"path","name":"id","description":"User ID","type":"integer","format":"int32","required":true}],"responses":{"200":{"description":"Get user info by |
| - id: 71274 | |
| title: ALL MOONROCKS BOGO GRAM @ $25!!! | |
| body: BOGO GRAM @ $25 ON ALL MOONROCKS ALL DAY!!! | |
| coupon_type: daily | |
| discount_type: bogo | |
| discount_amount: | |
| distance: | |
| value: 7.330996145791065 | |
| units: mi | |
| url: "/deals#/709926" |
| defmodule Episode do | |
| defstruct id: nil, name: nil, video: nil, markdown: nil, post: nil | |
| def get_all do | |
| [ | |
| %Episode{id: "001", post: "271", name: "Introduction and Installing Elixir", video: "1366", markdown: "1382"}, | |
| %Episode{id: "002", post: "275", name: "Basic Elixir", video: "1367", markdown: "1357"}, | |
| %Episode{id: "003", post: "280", name: "Pattern Matching", video: "14879", markdown: "1413"}, | |
| %Episode{id: "004", post: "284", name: "Functions", video: "5086", markdown: "1559"}, | |
| %Episode{id: "005", post: "298", name: "Mix and Modules", video: "5087", markdown: "1654"}, |
| require 'yaml' | |
| desc "Generates database.yml, optional arguments are allowed: [username, password, adapter, project_path]" | |
| task :dbconfig => 'database.yml' | |
| file 'database.yml', [:username, :password, :adapter, :project_path] do |t, args| | |
| Dir.chdir('config') | |
| args.with_defaults(:project_path => Dir.pwd) | |
| DBConfigGenerator.new(t, args).generate | |
| end |
| $ rails g model switchable_plan origin:references replacement:references 'switch_plan_fee:decimal{15,2}' | |
| # app/models/switchable_plan.rb | |
| class SwitchablePlan < ActiveRecord::Base | |
| belongs_to :origin | |
| belongs_to :replacement | |
| end | |
| # db/migrate/20131128082637_create_switchable_plans.rb | |
| class CreateSwitchablePlans < ActiveRecord::Migration |
| # model | |
| after_validation :log_errors, :if => Proc.new {|m| m.errors} | |
| def log_errors | |
| Rails.logger.debug self.errors.full_messages.join("\n") | |
| end |
| # This custom matcher can be used to test state machine | |
| # | |
| # Examples | |
| # | |
| # transition = OpenStruct.new(:name => :operation1, :state_field => :status, :from => :state1, :to => :state2) | |
| # it { should have_transition(transition) } | |
| # | |
| # transition = {:name => :operation2, :state_field => :status, :from => :state2, :to => :state3} | |
| # it { should have_transition(transition) } | |
| RSpec::Matchers.define :have_transition do |transition| |