Skip to content

Instantly share code, notes, and snippets.

View miere's full-sized avatar
😁
Distributing data among friends

Miere Teixeira miere

😁
Distributing data among friends
View GitHub Profile
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.RoutingHandler;
import org.junit.Test;
public class RoutingHandlerTest {
@Test
public void ensureItsPossibleToHandlePostAndGetToSameURL() {
@miere
miere / PersonAgeIncrementService.java
Last active August 29, 2015 14:06
Concurrent change on single element of Hazelcast IMap
class PersonAgeIncrementService {
@Provided
@Source( "persons" )
IMap< Long, Person > map;
public void incrementPerson( long index ){
map.lock( index );
try {
val person = map.get( index );
package sample;
import io.undertow.server.HttpServerExchange;
import java.io.IOException;
import java.io.Reader;
import java.nio.channels.Channels;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JSONConverver {
package com.mastersaf.integrator.infor;
import static org.junit.Assert.assertThat;
import java.util.ArrayList;
import lombok.val;
import org.hamcrest.Matchers;
import org.junit.Test;
@miere
miere / HttpServerExchangeStub.java
Created July 23, 2014 18:58
Stub for HttpServerExchange tests.
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.ServerConnection;
import io.undertow.server.protocol.http.HttpServerConnection;
import io.undertow.util.HeaderMap;
import io.undertow.util.HttpString;
import io.undertow.util.Protocols;
@miere
miere / boilerplate.sh
Created May 27, 2014 14:23
A nice boilerplate for your Shell scripts
#!/bin/bash
# FUNCTIONS
print(){
echo ":: $@" 1>&2
}
# VARIABLES
# USAGE CHECK
@miere
miere / c-archive-readme.md
Last active August 29, 2015 14:01
C Archive - A tool to create static libraries ( *.a ) for your C projects

car - C Archive

A tool to create static libraries ( *.a ) for your C projects.

Usage

# The syntax is: car <output_file.a> <arq1.[ao]> ... <arqn.[ao]>
$ car librequester.a libraries/libttm.a *.o
:: Creating up 'output'
:: Created librequester.a

Working Effectively with Legacy Code

Notes by Jeremy W. Sherman, October 2013, based on:

Feathers, Michael. Working Effectively with Legacy Code. Sixth printing, July 2007.

Foreword:

  • Software systems degrade into a mess.
  • Requirements ALWAYS change.   - Your goal as a software developer: Create designs that tolerate change.
@miere
miere / ASuccessfulGitBranchingModel.md
Created May 8, 2014 22:40
A successful Git branching model

A successful Git branching model

A straightforward version from Vincent Driessen article.

Creating a feature branch

Create a copy branch from develop.

$ git checkout -b feature-1 develop

Merge with develop after code your feature.

@miere
miere / BlindWarriorI.md
Last active July 30, 2025 20:18
A nice game to practice OOP

Blind Warrior I

An easy to dev game to practice SOLID and other Clean Architecture Principles. In this game, only a few features will be implemented.

Description

Blind Warrior is a command line game. It tells a history where a blind warrior named ZISKA. Some day, during his daily morning coffee at the Queen Sophia's Cafeteria, the entire city was invaded by the army of the German Empire. A noble hero does not flee without a fight: Ziska took a weapon and starts to fight against all enemies.

The Game Interface

The game will have no input options. Here what it will do:

  • the player will start the game
  • the game will create the player