This file contains 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
# Rakefile | |
begin | |
require 'rspec/core/rake_task' | |
desc 'Provide private interfaces documentation' | |
RSpec::Core::RakeTask.new(:spec) | |
namespace :spec do | |
desc 'Provide public interfaces documentation' |
This file contains 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
# Rakefile | |
# Add Rainbow to the app dependencies. That's optional, but the result is worth it. | |
require 'rainbow' | |
# ... | |
# Validate an API against its API blueprint | |
# | |
# The API blueprints are expected to be stored in `doc/` and |
This file contains 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
# ... | |
# Add these lines at the end of your ~/.bash_profile | |
# Git functions (used to define a custom prompt) | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
This file contains 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
# safe merge | |
# | |
# merge the branch XXXXXXXX-add-example-feature into master | |
# make sure the feature is properly tested and | |
# doesn't break anything in its original context | |
git checkout XXXXXXXX-add-example-feature | |
rake # the test suite MUST NOT raise any error | |
# make sure your local copy of master is up-to-date |
This file contains 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
# app/controllers/sessions_controller.rb | |
class SessionsController < Devise::SessionsController | |
# This controller provides a JSON version of the Devise::SessionsController and | |
# is compatible with the use of SimpleTokenAuthentication. | |
# See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/27 | |
def create | |
# Fetch params |
This file contains 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
--- | |
layout: nil | |
--- | |
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text" xml:lang="en">{{ site.root_desc }}</title> | |
<link type="application/atom+xml" href="http://paulstamatiou.com/feed/" rel="self"/> | |
<link type="text" href="http://paulstamatiou.com" rel="alternate"/> | |
<updated>{{ site.time | date_to_xmlschema }}</updated> |
This file contains 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
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :authentication_token, :string | |
add_index :users, :authentication_token, :unique => true | |
end | |
end |
This file contains 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
# features/step_definitions/api_steps.rb | |
# These steps are very deeply inspired in the Anthony Eden (@aeden) API steps. | |
# See http://vimeo.com/30586709 | |
# Given | |
Given /^I send and accept JSON$/ do | |
header 'Accept', 'application/json' |
This file contains 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
# lib/custom_form_builder.rb | |
# See https://github.com/plataformatec/simple_form#custom-form-builder | |
class CustomFormBuilder < SimpleForm::FormBuilder | |
def input(attribute_name, options = {}, &block) | |
if options[:wrapper_html] | |
options[:wrapper_html].merge! class: 'form-group' | |
else | |
options[:wrapper_html] = { class: 'form-group' } | |
end |
This file contains 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 | |
# lib/tbk/webpay/logger.rb | |
# Copyright (c) 2013 Acid Ltda <www.acid.cl> | |
# Copyright (c) 2013 Gonzalo Bulnes Guilpain <[email protected]> | |
# Copyright (c) 2013 Cristián Carreño <[email protected]> | |
# | |
# This code is distributed under the same license than TBK-Rails, | |
# see https://github.com/kiel-cristian/tbk-rails for details. | |
module TBK |