Skip to content

Instantly share code, notes, and snippets.

@kurko
kurko / gist:9664123
Created March 20, 2014 13:49
How to: Stories and communication

Communication

Here are some good practices about communication within an Agile project.

TL;DR about stories

There are some general rules about stories. A story:

  • can't be started if it's not estimated
  • can't be estimated if it's not clear enough
@kurko
kurko / gist:10024698
Last active August 29, 2015 13:58
Jenkins vs SemaphoreApp vs TravisCI

Jenkins is the name of server we use right. SemaphoreApp is the service which we'd like to use instead.

Newer project:

Test Semaphore Jenkins TravisCI CircleCI
Master 2:08 5:28 3:42 1:59
Integration 2:23 7:45 5:05 2:30
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
#protect_from_forgery with: :exception
before_action :set_headers
def set_headers
headers["Endpoint-Purpose"] = "point_of_sale"
if Rails.env.development?
@kurko
kurko / gist:c6b905280882a4639e95
Created September 6, 2014 22:33
Dynamic vs static

Dynamically typed vs statically typed

# Example 1
def order(user, shipping_method, cart)
  # ...
end

Tell Don't Ask

diff --cc lib/active_model/serializer/adapter/json_api.rb
index f604b67,cd8de8e..0000000
--- a/lib/active_model/serializer/adapter/json_api.rb
+++ b/lib/active_model/serializer/adapter/json_api.rb
@@@ -16,18 -17,19 +17,33 @@@ module ActiveMode
end
def serializable_hash(options = {})
+ @root = (@options[:root] || serializer.json_key.to_s.pluralize).to_sym
+
# Given
# /auth/:section_token/?redirect_url=:redirection_with_token/?option=:option
entity = Instructor.find(5)
# this is a token that expires
confirmation_token = TokenModel.new_for_entity(
entity_id: entity.token,
type: :confirmation
)
@kurko
kurko / transform_to_utf.php
Created October 16, 2009 17:28
Tranforme todos os arquivos de um diretório e suas subpastas de ISO-8859-1 para UTF-8. Cuidado: não rode este script em arquivo que não sejam ISO-8859-1, senão você vai perder seus arquivos. Para se precaver contra isto, é necessário implementar uma verif
<?php
/*
* NÃO USE ESTE SCRIPT SOBRE ARQUIVOS UTF-8! VOCẼ PERDERÁ TUDO.
*
* Não use este arquivo sem fazer Backup dos arquivos antes.
*
* Alterações necessárias:
* - verificar se o arquivo atual é ISO-8859-1 realmente.
* - verificar se é um arquivo de texto (transformar imagens vai inutilizá-las
*/
@kurko
kurko / gist:af8676d5c67e356704e5
Last active September 21, 2015 04:32
OMG I HATE SPRING
(2.2.0p0, Rails 4.2.0) ~/src/app (production↓)
→ git status
On branch production
Your branch is behind 'origin/production' by 26 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Gemfile.lock
@kurko
kurko / event_handler_for_vars.js
Created February 9, 2011 14:25
Connects variables to callbacks, making it possible to connect JS views to models
/*
event_handler.js adds a layer for setting variables in Javascript
and calling a callback whenever it is changed.
You won't need to call a function manually to update your view.
This method makes it easy to separated view-logic from business-logic
at Javascript level, and let things run automatically.
*/