Skip to content

Instantly share code, notes, and snippets.

Agnaldo de Oliveira agnaldo4j

Block or report user

Report or block agnaldo4j

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@agnaldo4j
agnaldo4j / crawler_example.md
Last active Oct 15, 2016
Crawler example with mochiweb_html and mochiweb_xpath.
View crawler_example.md

Elixir simple crawler example

This example uses thease projects:

  1. mochiweb
  2. mochiweb_xpath

The HtmlPageReader goes to html's page and transform that content with mochiweb_html.parse

defmodule Usecase.HtmlPageReader do
@agnaldo4j
agnaldo4j / InstallOpenCV
Last active Jan 23, 2016
Install OpenCV
View InstallOpenCV
#!/bin/bash
mkdir OpenCVInstall
cd OpenCVInstall
rm -rf last_stable_x264.tar.bz2
rm -rf x264-snapshot-20140930-2245-stable
rm -rf ffmpeg-2.4.1.tar.bz2
@agnaldo4j
agnaldo4j / UserAPI.scala
Created Jan 16, 2016
Exemplo de endpoint acessando usecases
View UserAPI.scala
package com.opportunity.simple.restapi
import javax.persistence.EntityManagerFactory
import com.opportunity.objectives.model.User
import com.opportunity.objectives.usecases.user.{ListUsersUsecase, LoginByFacebookUserUsecase, SaveNewUserUsecase}
import com.opportunity.simple.restapi.response.ProtocolResponse
import com.typesafe.config.Config
class UserAPI(val apiConfig: Config, val entityManagerFactory: EntityManagerFactory) extends Respondable with Authenticable with PersistibleUser {
View SaveNewFriendsUsecase.scala
package com.opportunity.objectives.usecases.user
import com.opportunity.objectives.exceptions.UserInvalidException
import com.opportunity.objectives.model.{Friend, User}
import com.opportunity.objectives.persistence.adapter.user.NewUserPersistenceAdapter
class SaveNewFriendsUsecase(persistenceAdapter: NewUserPersistenceAdapter) {
def save(user:User, friends:List[Friend]): User = {
persistenceAdapter.findUserById(user.id) match {
@agnaldo4j
agnaldo4j / SaveNewFriendsUsecaseSpec.scala
Created Jan 12, 2016
Exemplo de teste usando specs2 e arquitetura limpa
View SaveNewFriendsUsecaseSpec.scala
/**
* https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
* https://vimeo.com/43612849
* https://etorreborre.github.io/specs2/guide/SPECS2-3.7/org.specs2.guide.Matchers.html
*
**/
package com.opportunity.objectives.usecases.user
import com.opportunity.objectives.exceptions.UserInvalidException
import com.opportunity.objectives.model.{Friend, User}
@agnaldo4j
agnaldo4j / macro.exs
Last active Jan 7, 2016
Executando código dinâmico em elixir
View macro.exs
Code.eval_quoted(
quote do: unquote(1) + unquote(1 + 1)
)
#code to be parsed 1 + (1 + 1)
#result of execution {3, []}
View BabyStepsAgile
Sugestões de práticas para melhora da previsibilidade na execução de Sprints.
1. Gerenciar e manter backlog atualizado e priorizado(PO ou ProxyPO)
Princípio: Tornar o PO ou ProxyPO comprometido com o resultado do produto
Valor: Visão de produto melhorado a cada revisão e conhecimento do que é mais importante.
Prática: Reservar 8 ou 16 horas por semana para revisar o backlog, levando em consideração o que já foi entregue, mudanças de mercado e mudanças de visão do produto.
2. Doutrinar o cliente para uso da ferramenta de gestão de backlog (JIRA) (ProxyPO)
@agnaldo4j
agnaldo4j / ErlangJSON.md
Created Aug 28, 2013
Parser JSON para Erlang
View ErlangJSON.md
@agnaldo4j
agnaldo4j / BuildErlang.md
Created Aug 23, 2013
Trilha de estudos para preparar um projeto Erlang.
View BuildErlang.md
@agnaldo4j
agnaldo4j / ScalaSpringData.scala
Created Jul 29, 2013
Acesso a dados com Scala e SpringData.
View ScalaSpringData.scala
import javax.sql.DataSource
import scala.collection.JavaConversions._
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.util.LinkedCaseInsensitiveMap
import org.springframework.jdbc.datasource.DriverManagerDataSource
/*
You can’t perform that action at this time.