Skip to content

Instantly share code, notes, and snippets.

@perezpaya
perezpaya / sublime_config
Created October 8, 2014 08:15
Sublime Config
{
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"ignored_packages":
[
"JSLint",
"Vintage",
"JSHint"
],
"rulers":
[
@perezpaya
perezpaya / .vimrc
Created December 10, 2014 12:34
Vimerinos
set nocompatible " be iMproved, requires
set shell=/bin/bash
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

How to iOS

Dear iOS Developer,

These are the things you might take into account when developing rock-solid iOS apps.

Writing better code makes you happy and will make your employer, teammates, and even customers happier in the mid-long term.

Please remember

{
"characters": [{
"name": "Itxa",
"realm": "Outland",
"battlegroup": "Misery",
"class": 8,
"race": 7,
"gender": 1,
"level": 0,
"achievementPoints": 0,
class Company < Model
attribute :stock_symbol, type: String
attribute :name, type: String
attribute :stock_price, type: Float
attribute :stock_volume, type: Integer
attribute :number_of_shares, type: Integer
has_one :ceo, class_name: 'Person'
def volume_price
class CompanyController < ApplicationController
def index
render json: Company.all,
serializer: ActiveModel::Serializer::CollectionSerializer,
each_serializer: CompanySerializer
end
end
get 'companies' => 'company#index'
namespace :webhooks do
post 'company_market_updates' => 'company_market_updates#update'
end
class RegisterController < ApplicationController
def create
render json: UserService.new.register(registration_params)
rescue RegistrationError
render json: {message: 'User already registered'}, status_code: 422
end
private
def registration_params
class CompanyMarketUpdatesController < ApplicationController
def update
CompanyMarketUpdatesJob.perform_later(update_params)
render json: {sucess: true}, status: 202
end
private
def update_params
params.extract!(:stock_symbol, :stock_volume, :stock_price)